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
a0e84269
Commit
a0e84269
authored
Aug 11, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修改loading界面。 2. 暂留GetResponseWithType方法,待实现。
parent
f3e61a35
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
5 deletions
+81
-5
sbkpay/control.cpp
+2
-0
sbkpay/hostwidget.ui
+1
-1
sbkpay/jsonfactory.h
+78
-4
sbkpay/res/loading.gif
+0
-0
No files found.
sbkpay/control.cpp
View file @
a0e84269
...
...
@@ -180,4 +180,6 @@ void Control::RequestWithType(ReqType type, QStringList list)
SendMessageToPayMent
(
json
,
outdata
);
QLOG_INFO
()
<<
outdata
.
data
();
JsonFactory
::
GetResponseWithType
(
type
,
outdata
,
_response
);
}
sbkpay/hostwidget.ui
View file @
a0e84269
...
...
@@ -601,7 +601,7 @@
</size>
</property>
<property
name=
"text"
>
<string
>
TextLabel
</string
>
<string
/
>
</property>
</widget>
</widget>
...
...
sbkpay/jsonfactory.h
View file @
a0e84269
...
...
@@ -7,6 +7,8 @@
#include <QJsonObject>
#include <QJsonArray>
#include <QStringList>
#include <QJsonParseError>
#include <QJsonDocument>
class
JsonFactory
{
...
...
@@ -20,9 +22,33 @@ public:
if
(
type
==
endday
)
return
GetDayEndJson
(
json
,
request
,
list
);
if
(
type
==
againprint
)
return
GetAgainPrinte
r
(
json
,
request
,
list
);
return
GetAgainPrinte
Json
(
json
,
request
,
list
);
if
(
type
==
find
)
return
GetFind
(
json
,
request
,
list
);
return
GetFindJson
(
json
,
request
,
list
);
return
false
;
}
static
bool
GetResponseWithType
(
ReqType
type
,
const
QByteArray
&
rspJsonData
,
AlipayResponse
&
response
)
{
QJsonParseError
parseError
;
QJsonDocument
doc
=
QJsonDocument
::
fromJson
(
rspJsonData
,
&
parseError
);
if
(
parseError
.
error
!=
QJsonParseError
::
NoError
)
{
return
false
;
}
QJsonObject
rspJsonObj
=
doc
.
object
();
if
(
type
==
pay
)
return
GetPayResponse
(
rspJsonObj
,
response
);
if
(
type
==
refund
)
return
GetRefundResponse
(
rspJsonObj
,
response
);
if
(
type
==
endday
)
return
GetDayEndResponse
(
rspJsonObj
,
response
);
if
(
type
==
againprint
)
return
GetAgainPrinteResponse
(
rspJsonObj
,
response
);
if
(
type
==
find
)
return
GetFindResponse
(
rspJsonObj
,
response
);
return
false
;
}
private
:
...
...
@@ -97,18 +123,66 @@ private:
//日结
static
bool
GetDayEndJson
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
{
if
(
list
.
size
()
!=
1
||
list
[
0
].
isEmpty
())
return
false
;
json
.
insert
(
JSON_KEY_VER
,
DEFAULT_JSON_VER_VALUE
);
json
.
insert
(
JSON_KEY_REQTYPE
,
JSON_REQTYPE_REFUND
);
json
.
insert
(
JSON_KEY_PARTNERID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
Reserved1
),
48
));
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
return
true
;
}
//重打小票
static
bool
GetAgainPrinte
r
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
static
bool
GetAgainPrinte
Json
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
{
if
(
list
.
size
()
!=
2
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
return
false
;
json
.
insert
(
JSON_KEY_VER
,
DEFAULT_JSON_VER_VALUE
);
json
.
insert
(
JSON_KEY_REQTYPE
,
JSON_REQTYPE_REFUND
);
json
.
insert
(
JSON_KEY_PARTNERID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
Reserved1
),
48
));
json
.
insert
(
JSON_KEY_STOREID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
StoreNo
),
20
));
json
.
insert
(
JSON_KEY_STATIONID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
DeviceNo
),
6
));
json
.
insert
(
JSON_KEY_OPERATORID
,
FMTool
::
GetString
((
const
void
*
)
&
(
request
.
CashierNo
),
6
));
json
.
insert
(
JSON_KEY_FMID
,
list
[
1
]);
return
true
;
}
//查询流水
static
bool
GetFind
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
static
bool
GetFind
Json
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
{
return
true
;
}
// 支付AlipayResponse
static
bool
GetPayResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
{
return
true
;
}
// 退款AlipayResponse
static
bool
GetRefundResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
{
return
true
;
}
// 日结AlipayResponse
static
bool
GetDayEndResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
{
return
true
;
}
// 重打小票AlipayResponse
static
bool
GetAgainPrinteResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
{
return
true
;
}
// 查询AlipayResponse
static
bool
GetFindResponse
(
const
QJsonObject
&
rspJsonObj
,
AlipayResponse
&
response
)
{
return
true
;
}
};
#endif // JSONFACTORY
...
...
sbkpay/res/loding.gif
→
sbkpay/res/lo
a
ding.gif
View file @
a0e84269
File moved
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