Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sbkpay
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
sbkpay
Commits
216ee36f
Commit
216ee36f
authored
Nov 03, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 兼容由POS传支付条码。 2. 不再检查条码卡bin。
parent
7de539ee
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
13 deletions
+31
-13
sbkpay/control.cpp
+7
-7
sbkpay/global.h
+1
-0
sbkpay/hostwidget.cpp
+20
-4
sbkpay/main.cpp
+1
-1
sbkpay/version.h
+1
-1
tests/TestSimphony/tst_testsimphony.cpp
+1
-0
No files found.
sbkpay/control.cpp
View file @
216ee36f
...
...
@@ -119,7 +119,7 @@ void Control::Start(const char *indata, char *outdata)
_widget
->
ShowWithRequest
(
_posType
,
_posReqJsonObj
);
if
(
reqType
!=
refund
)
if
(
reqType
!=
refund
&&
reqType
!=
pay
)
{
loop
.
exec
();
}
else
...
...
@@ -583,12 +583,12 @@ void Control::Request(ReqType type, QStringList list)
_fmId
=
list
[
0
];
bool
isOk
=
true
;
if
(
type
==
pay
)
{
if
(
!
IsValidCode
(
list
[
0
]))
{
isOk
=
false
;
SetResPonseWithMessage
(
"23"
,
QString
::
fromLocal8Bit
(
"无效条码"
));
}
}
//
if(type == pay) {
//
if(!IsValidCode(list[0])) {
//
isOk = false;
//
SetResPonseWithMessage("23", QString::fromLocal8Bit("无效条码"));
//
}
//
}
if
(
isOk
)
{
JsonFactory
::
GetJsonWithType
(
type
,
json
,
_posReqJsonObj
,
list
);
...
...
sbkpay/global.h
View file @
216ee36f
...
...
@@ -45,6 +45,7 @@
#define JSON_KEY_PAYACCOUNT "payAccount"
#define JSON_KEY_PAYTRANSID "payTransId"
#define JSON_KEY_TYPE "type"
#define JSON_KEY_CODE "code"
#define JSON_KEY_FMID "fmId"
#define JSON_KEY_EXT "ext"
#define JSON_KEYT_STATE "state"
...
...
sbkpay/hostwidget.cpp
View file @
216ee36f
...
...
@@ -364,10 +364,26 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
case
pay
:
{
ShowWidget
(
ui
->
pay
);
_curr_show_widget
=
ui
->
pay
;
double
Amount
=
FMTool
::
GetJsonValue
(
requestObj
,
JSON_KEY_TRANSAMOUNT
).
toInt
()
/
100.0
;
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付宝二维码"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
QString
reqCode
=
requestObj
[
JSON_KEY_CODE
].
toString
(
""
);
if
(
reqCode
.
isEmpty
())
{
double
Amount
=
FMTool
::
GetJsonValue
(
requestObj
,
JSON_KEY_TRANSAMOUNT
).
toInt
()
/
100.0
;
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付宝二维码"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
}
else
{
ui
->
btn_pay_exit
->
hide
();
ui
->
label_pay_money
->
hide
();
_label_pay_timer
->
start
(
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
QStringList
list
;
list
.
append
(
reqCode
);
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"支付中/等待用户输入密码"
));
_intertime
.
start
(
5
*
1000
);
emit
RequestWithType
(
pay
,
list
);
}
break
;
}
case
refund
:
{
...
...
sbkpay/main.cpp
View file @
216ee36f
...
...
@@ -402,7 +402,7 @@ int main(int argc, char *argv[])
// control.Start(as, b);
// char spccIn[MAX_BUF_LEN] = "{\"fmId\":\"11971709011000000002\",\"reqType\":352,\"storeId\":\"1713\",\"stationId\":\"1\",\"partnerId\":1438,\"operatorId\":\"0123\",\"transId\":301439,\"transAmount\":1,\"partnerOrderId\":\"909911039990170830002\",\"businessDate\":\"20170508\",\"products\":[{\"pid\":\"123\",\"name\":\"中杯拿铁\",\"price\":321,\"salesType\":\"NORMAL\"}]}";
char
spccIn
[
MAX_BUF_LEN
]
=
"{
\"
reqType
\"
:352,
\"
storeId
\"
:
\"
1713
\"
,
\"
stationId
\"
:
\"
1
\"
,
\"
partnerId
\"
:1438,
\"
operatorId
\"
:
\"
0123
\"
,
\"
transId
\"
:301439,
\"
transAmount
\"
:1,
\"
partnerOrderId
\"
:
\"
201709280001
\"
,
\"
businessDate
\"
:
\"
20170830
\"
}"
;
char
spccIn
[
MAX_BUF_LEN
]
=
"{
\"
reqType
\"
:352,
\"
storeId
\"
:
\"
1713
\"
,
\"
code
\"
:
\"
1212121
\"
,
\"
stationId
\"
:
\"
1
\"
,
\"
partnerId
\"
:1438,
\"
operatorId
\"
:
\"
0123
\"
,
\"
transId
\"
:301439,
\"
transAmount
\"
:1,
\"
partnerOrderId
\"
:
\"
201709280001
\"
,
\"
businessDate
\"
:
\"
20170830
\"
}"
;
// char spccIn[MAX_BUF_LEN] = "{\"fmId\":\"64761709011000001002\",\"reqType\":453,\"storeId\":\"17607\",\"stationId\":\"1\",\"partnerId\":1443,\"operatorId\":\"0123\",\"transId\":301439,\"transAmount\":1,\"partnerOrderId\":\"1365670843098735011754\",\"businessDate\":\"20170830\"}";
control
.
Start
(
spccIn
,
b
);
...
...
sbkpay/version.h
View file @
216ee36f
...
...
@@ -3,7 +3,7 @@
#define VER_MAJOR 0
#define VER_MINOR 2
#define VER_REVISION
3
#define VER_REVISION
4
#define VER_BUILD 0
...
...
tests/TestSimphony/tst_testsimphony.cpp
View file @
216ee36f
...
...
@@ -220,6 +220,7 @@ void TestSimphony::test_POSRequest_data()
"
\"
storeId
\"
:
\"
1713
\"
, "
"
\"
transAmount
\"
: %3, "
"
\"
transId
\"
: 301439 "
"
\"
code
\"
:
\"
12312
\"
"
"}"
)
.
arg
(
QDate
::
currentDate
().
toString
(
"yyyyMMdd"
))
.
arg
(
CreatePartnerOrderId
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment