Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_epay
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
fmp_epay
Commits
08b1919c
Commit
08b1919c
authored
Mar 28, 2019
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 扫码支付添加查询接口
parent
924b3007
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
12 deletions
+93
-12
CMakeLists.txt
+0
-2
fmp_epay_p.cpp
+87
-3
fmp_epay_p.h
+2
-0
res/MANIFEST.MF
+1
-1
version.h
+3
-6
No files found.
CMakeLists.txt
View file @
08b1919c
...
...
@@ -7,8 +7,6 @@ set(CMAKE_AUTOMOC ON)
set
(
CMAKE_AUTOUIC ON
)
set
(
CMAKE_AUTORCC ON
)
set
(
CMAKE_BUILD_TYPE Debug
)
find_package
(
Qt5 COMPONENTS Widgets Gui Core Sql Network Concurrent REQUIRED
)
IF
(
CMAKE_BUILD_TYPE MATCHES
"Debug"
)
...
...
fmp_epay_p.cpp
View file @
08b1919c
...
...
@@ -184,6 +184,13 @@ void FMPePayPrivate::Init()
// ControlRefundJson(trans);
// return;
// }
}
else
if
(
_origin_request
[
"fm_cmd"
].
toInt
()
==
10030
)
{
//组装支付查询接口的json
QJsonObject
obj
;
connect
(
this
,
&
FMPePayPrivate
::
finished
,
this
,
&
FMPePayPrivate
::
confirmClicked
);
connect
(
this
,
&
FMPePayPrivate
::
error
,
this
,
&
FMPePayPrivate
::
confirmClicked
);
ControlQueryJson
(
obj
);
return
;
}
QJsonArray
pos_products
=
_origin_request
[
"products"
].
toArray
();
QJsonArray
products
;
...
...
@@ -324,13 +331,49 @@ QByteArray FMPePayPrivate::DockRefundRespond()
void
FMPePayPrivate
::
DockQueryRequest
(
const
QByteArray
&
json
)
{
//!TODO DockQueryRequest()
_is_api
=
true
;
_api_abort
=
false
;
_origin_request
=
QJsonDocument
::
fromJson
(
json
).
object
();
}
QByteArray
FMPePayPrivate
::
DockQueryRespond
()
{
//!TODO DockQueryRespond()
return
""
;
QByteArray
json
=
"{
\"
statusCode
\"
:106,
\"
msg
\"
:
\"\347\252\227\345\217\243\345\267\262\345\205\263\351\227\255\357\274\214\344\272\244\346\230\223\345\217\226\346\266\210\"
,
\"
prompt
\"
:0}"
;
_api_evt
.
exec
();
if
(
!
_api_abort
)
{
_docked_response
=
QJsonObject
();
_docked_response
[
FMP_EPAY_STATUSCODE
]
=
_origin_response
[
FMP_EPAY_STATUSCODE
];
_docked_response
[
FMP_EPAY_ERRORMSG
]
=
_origin_response
.
contains
(
"msg"
)
?
_origin_response
[
FMP_EPAY_ERRORMSG
]
:
QJsonValue
(
""
);
_docked_response
[
"prompt"
]
=
0
;
if
(
_origin_response
[
"statusCode"
].
toInt
()
==
100
)
{
_docked_response
[
"fm_transId"
]
=
_origin_response
[
"pay_transId"
];
_docked_response
[
FMP_EPAY_FMID
]
=
_origin_response
[
"fmId"
];
_docked_response
[
FMP_EPAY_PAYED_AMOUNT
]
=
_origin_response
[
"total_amount"
];
_docked_response
[
FMP_EPAY_INVOICE_AMOUNT
]
=
_origin_response
[
FMP_EPAY_INVOICE_AMOUNT
];
_docked_response
[
FMP_EPAY_DISCOUNT_AMOUNT
]
=
_origin_response
[
"mcoupon_amount"
].
toInt
()
+
_origin_response
[
"pcoupon_amount"
].
toInt
();
QJsonArray
pay_channels
;
QJsonObject
pay_ch
;
pay_ch
[
FMP_EPAY_PAY_ID
]
=
_origin_response
[
"pay_ebcode"
];
pay_ch
[
FMP_EPAY_PAY_DESC
]
=
_origin_response
[
"pay_id"
];
pay_ch
[
"code"
]
=
_origin_response
[
"code"
];
pay_ch
[
"pay_amount"
]
=
_origin_response
[
"total_amount"
];
pay_ch
[
"pay_account"
]
=
_origin_response
[
"pay_acount"
];
pay_ch
[
"platform_discount"
]
=
_origin_response
[
"mcoupon_amount"
];
pay_ch
[
"merchant_discount"
]
=
_origin_response
[
"pcoupon_amount"
];
if
(
_origin_response
.
contains
(
"ext"
))
{
pay_ch
[
"ext"
]
=
_origin_response
[
"ext"
];
}
pay_channels
.
append
(
pay_ch
);
_docked_response
[
FMP_EPAY_PAY_IDS
]
=
pay_channels
;
}
_origin_response
=
QJsonObject
();
json
=
QJsonDocument
(
_docked_response
).
toJson
();
}
return
json
;
}
...
...
@@ -399,6 +442,47 @@ void FMPePayPrivate::ControlPayJson(QString sum, QString code)
});
}
void
FMPePayPrivate
::
ControlQueryJson
(
const
QJsonObject
&
trans
)
{
QtConcurrent
::
run
(
[
&
,
trans
,
this
]()
{
Q_Q
(
FMPePay
);
_origin_response
=
QJsonObject
();
_docked_request
=
trans
;
_docked_request
[
FMP_EPAY_VER
]
=
3
;
_docked_request
[
FMP_EPAY_REQUESTTYPE
]
=
52
;
_docked_request
.
insert
(
FMP_EPAY_PARTNERID
,
q
->
_partner_id
.
toInt
());
_docked_request
[
FMP_EPAY_STOREID
]
=
_origin_request
[
FMP_EPAY_STOREID
];
_docked_request
[
FMP_EPAY_STATIONID
]
=
_origin_request
[
"pos_id"
];
_docked_request
[
FMP_EPAY_OPERATORID
]
=
_origin_request
[
FMP_EPAY_OPERATORID
];
_docked_request
[
FMP_EPAY_BUSINESSDATE
]
=
_origin_request
[
FMP_EPAY_BUSINESSDATE
];
_docked_request
[
FMP_EPAY_TRANSID
]
=
_origin_request
[
FMP_EPAY_TRANSID
].
toString
();
_docked_request
[
"fmId"
]
=
_origin_request
[
FMP_JKEY_FM_ORDERID
].
toString
();
FMP_INFO
()
<<
"query json : "
<<
_docked_request
;
QString
errors
;
QJsonObject
outjson
;
if
(
!
HttpPost
(
outjson
,
_docked_request
,
errors
,
q
->
_time_out
))
{
_origin_response
=
outjson
;
emit
error
(
errors
);
emit
apiError
();
}
else
{
if
(
_is_api
)
{
_origin_response
=
outjson
;
}
FMP_INFO
()
<<
"query rsponse : "
<<
_origin_response
;
emit
finished
(
outjson
);
}
});
}
//void FMPePayPrivate::ControlPayJson(QString sum, QString code)
//{
// Q_Q(FMPePay);
...
...
fmp_epay_p.h
View file @
08b1919c
...
...
@@ -29,6 +29,8 @@ public:
void
ControlPayJson
(
QString
sum
,
QString
code
);
void
ControlQueryJson
(
const
QJsonObject
&
trans
);
void
ControlRefundJson
(
const
QJsonObject
&
trans
);
void
GetCheckMode
(
QString
sum
);
...
...
res/MANIFEST.MF
View file @
08b1919c
Plugin-SymbolicName: fmp.epay
Plugin-Version: 0.1.0
Plugin-Name: fmp.epay
Plugin-Copyright: Freemud Ltd. Copyright (C) 2014-201
8
Plugin-Copyright: Freemud Ltd. Copyright (C) 2014-201
9
Plugin-Vendor: Freemud
version.h
View file @
08b1919c
#ifndef _VERSION_H_
#define _VERSION_H_
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 28
#define VER_BUILD 81
//! Convert version numbers to string
#define _STR(S) #S
...
...
@@ -13,14 +11,13 @@
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
#define RES_FILE_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_PRODUCT_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_STR_FILE_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_STR_PRODUCT_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_COMPANY_NAME "
上海非码网络科技有限公司
\0"
#define RES_COPYRIGHT "Freemud Ltd. Copyright (C) 2014-201
8
\0"
#define RES_COMPANY_NAME "
上海非码网络科技有限公司\0"
#define RES_COPYRIGHT "Freemud Ltd. Copyright (C) 2014-201
9
\0"
#define RES_FILE_DESC "fmp.epay\0"
#define RES_INTER_NAME "fmp.epay\0"
#define RES_FILE_NAME "fmp.epay\0"
...
...
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