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
1ad3c922
Commit
1ad3c922
authored
Apr 28, 2017
by
LIDINGDA\ldd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.配置获取门店号等相关信息。2.增加https通讯
parent
9416f0a1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
2 deletions
+22
-2
fmp_epay.cpp
+2
-1
fmp_epay.h
+1
-0
fmp_epay_def.h
+1
-0
fmp_epay_p.cpp
+17
-0
version.h
+1
-1
No files found.
fmp_epay.cpp
View file @
1ad3c922
...
@@ -7,9 +7,10 @@ class ctkPluginContext;
...
@@ -7,9 +7,10 @@ class ctkPluginContext;
FMPePay
::
FMPePay
(
ctkPluginContext
*
context
)
FMPePay
::
FMPePay
(
ctkPluginContext
*
context
)
:
FMPePayInterface
(
context
),
:
FMPePayInterface
(
context
),
_url
(
DEFAULT_EPAY_RWQUESTURL
),
//
_url(DEFAULT_EPAY_RWQUESTURL),
_inited
(
false
),
_inited
(
false
),
//_needanimation(false),
//_needanimation(false),
_partner_id
(
QString
(
""
)),
_databasename
(
DEFAULT_EPAY_DATABASENAME
),
_databasename
(
DEFAULT_EPAY_DATABASENAME
),
_table
(
DEFAULT_EPAY_TABLE
),
_table
(
DEFAULT_EPAY_TABLE
),
_businessdate
(
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd"
)),
_businessdate
(
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd"
)),
...
...
fmp_epay.h
View file @
1ad3c922
...
@@ -38,6 +38,7 @@ private:
...
@@ -38,6 +38,7 @@ private:
QString
_store_id
;
QString
_store_id
;
QString
_station_id
;
QString
_station_id
;
QString
_operator_id
;
QString
_operator_id
;
QString
_partner_id
;
//销售单保存时间
//销售单保存时间
...
...
fmp_epay_def.h
View file @
1ad3c922
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#define FMP_EPAY_STATIONID "station_id"
#define FMP_EPAY_STATIONID "station_id"
#define FMP_EPAY_STOREID "store_id"
#define FMP_EPAY_STOREID "store_id"
#define FMP_EPAY_TRANSID "trans_id"
#define FMP_EPAY_TRANSID "trans_id"
#define FMP_EPAY_PARTNERID "partnerId"
#define FMP_EPAY_TRANSTRACTION "transactions"
#define FMP_EPAY_TRANSTRACTION "transactions"
#define FMP_EPAY_TRANSTRACTION_AMOUNT "amount"
#define FMP_EPAY_TRANSTRACTION_AMOUNT "amount"
#define FMP_EPAY_TRANSTRACTION_CODE "code"
#define FMP_EPAY_TRANSTRACTION_CODE "code"
...
...
fmp_epay_p.cpp
View file @
1ad3c922
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include "fmp_database.h"
#include "fmp_database.h"
#include "fmp_epay_checkmodel.h"
#include "fmp_epay_checkmodel.h"
#include <QSslCertificate>
#include <QJsonParseError>
#include <QJsonParseError>
#include <QJsonDocument>
#include <QJsonDocument>
#include <QNetworkAccessManager>
#include <QNetworkAccessManager>
...
@@ -140,11 +141,18 @@ void FMPePayPrivate::Init()
...
@@ -140,11 +141,18 @@ void FMPePayPrivate::Init()
_setting
=
q
->
GetService
<
FMPSettingsInterface
>
(
q
->
_ctx
);
_setting
=
q
->
GetService
<
FMPSettingsInterface
>
(
q
->
_ctx
);
q
->
_url
=
_setting
->
GetString
(
FMP_INIKEY_EPAYURL
);
q
->
_store_id
=
_setting
->
GetString
(
FMP_INIKEY_LOGINSTOREID
);
q
->
_station_id
=
_setting
->
GetString
(
FMP_INIKEY_LOGINPOSID
);
q
->
_operator_id
=
_setting
->
GetString
(
FMP_INIKEY_LOGINCASHIER
);
q
->
_partner_id
=
_setting
->
GetString
(
FMP_INIKEY_LOGINPARTNERID
);
hash
[
FMP_EPAY_ANIMATION
]
=
_setting
->
GetBool
(
FMP_INIKEY_ANIMATION
);
hash
[
FMP_EPAY_ANIMATION
]
=
_setting
->
GetBool
(
FMP_INIKEY_ANIMATION
);
hash
[
FMP_EPAY_BUSINESSDATE
]
=
q
->
_businessdate
;
hash
[
FMP_EPAY_BUSINESSDATE
]
=
q
->
_businessdate
;
hash
[
FMP_EPAY_STOREID
]
=
q
->
_store_id
;
hash
[
FMP_EPAY_STOREID
]
=
q
->
_store_id
;
hash
[
FMP_EPAY_STATIONID
]
=
q
->
_station_id
;
hash
[
FMP_EPAY_STATIONID
]
=
q
->
_station_id
;
hash
[
FMP_EPAY_OPERATORID
]
=
q
->
_operator_id
;
hash
[
FMP_EPAY_OPERATORID
]
=
q
->
_operator_id
;
hash
[
FMP_EPAY_PARTNERID
]
=
q
->
_partner_id
;
_payDialog
=
new
FMPPayDialog
(
this
,
hash
);
_payDialog
=
new
FMPPayDialog
(
this
,
hash
);
}
}
...
@@ -273,9 +281,16 @@ bool FMPePayPrivate::HttpPost(QJsonObject& outjson, QJsonObject json, QString &e
...
@@ -273,9 +281,16 @@ bool FMPePayPrivate::HttpPost(QJsonObject& outjson, QJsonObject json, QString &e
QEventLoop
loop
;
QEventLoop
loop
;
QTimer
timer
;
QTimer
timer
;
QSslConfiguration
config
;
QList
<
QSslCertificate
>
certs
=
QSslCertificate
::
fromPath
(
qApp
->
applicationDirPath
()
+
"/client01.pem"
);
config
.
setPeerVerifyMode
(
QSslSocket
::
VerifyNone
);
config
.
setProtocol
(
QSsl
::
SslV3
);
config
.
setCaCertificates
(
certs
);
QNetworkAccessManager
manger
;
QNetworkAccessManager
manger
;
QNetworkRequest
request
(
q
->
_url
);
QNetworkRequest
request
(
q
->
_url
);
request
.
setSslConfiguration
(
config
);
request
.
setRawHeader
(
"Content-Type"
,
"text/json"
);
request
.
setRawHeader
(
"Content-Type"
,
"text/json"
);
QNetworkReply
*
reply
=
manger
.
post
(
request
,
QJsonDocument
(
json
).
toJson
());
QNetworkReply
*
reply
=
manger
.
post
(
request
,
QJsonDocument
(
json
).
toJson
());
...
@@ -473,6 +488,7 @@ bool FMPePayPrivate::GetPayJson(const QString& sum, const QString& code)
...
@@ -473,6 +488,7 @@ bool FMPePayPrivate::GetPayJson(const QString& sum, const QString& code)
_current_json
.
insert
(
FMP_EPAY_VER
,
ver
);
_current_json
.
insert
(
FMP_EPAY_VER
,
ver
);
_current_json
.
insert
(
FMP_EPAY_REQUESTTYPE
,
72
);
_current_json
.
insert
(
FMP_EPAY_REQUESTTYPE
,
72
);
_current_json
.
insert
(
FMP_EPAY_PARTNERID
,
q
->
_partner_id
.
toInt
());
_current_json
.
insert
(
FMP_EPAY_BUSINESSDATE
,
q
->
_businessdate
);
_current_json
.
insert
(
FMP_EPAY_BUSINESSDATE
,
q
->
_businessdate
);
_current_json
.
insert
(
FMP_EPAY_CLIENTREQCOUNT
,
(
int
)((
++
s_ClientReqCount
)
%=
10000000
));
_current_json
.
insert
(
FMP_EPAY_CLIENTREQCOUNT
,
(
int
)((
++
s_ClientReqCount
)
%=
10000000
));
_current_json
.
insert
(
FMP_EPAY_STOREID
,
q
->
_store_id
);
_current_json
.
insert
(
FMP_EPAY_STOREID
,
q
->
_store_id
);
...
@@ -517,6 +533,7 @@ bool FMPePayPrivate::GetRefundJson(const QString &sum, const QString &code, QStr
...
@@ -517,6 +533,7 @@ bool FMPePayPrivate::GetRefundJson(const QString &sum, const QString &code, QStr
_current_json
.
insert
(
FMP_EPAY_VER
,
ver
);
_current_json
.
insert
(
FMP_EPAY_VER
,
ver
);
_current_json
.
insert
(
FMP_EPAY_REQUESTTYPE
,
62
);
_current_json
.
insert
(
FMP_EPAY_REQUESTTYPE
,
62
);
_current_json
.
insert
(
FMP_EPAY_PARTNERID
,
q
->
_partner_id
.
toInt
());
_current_json
.
insert
(
FMP_EPAY_CLIENTREQCOUNT
,
(
int
)((
++
s_ClientReqCount
)
%=
10000000
));
_current_json
.
insert
(
FMP_EPAY_CLIENTREQCOUNT
,
(
int
)((
++
s_ClientReqCount
)
%=
10000000
));
_current_json
.
insert
(
FMP_EPAY_STOREID
,
q
->
_store_id
);
_current_json
.
insert
(
FMP_EPAY_STOREID
,
q
->
_store_id
);
_current_json
.
insert
(
FMP_EPAY_STATIONID
,
q
->
_station_id
);
_current_json
.
insert
(
FMP_EPAY_STATIONID
,
q
->
_station_id
);
...
...
version.h
View file @
1ad3c922
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_REVISION 0
#define VER_BUILD
7
#define VER_BUILD
8
//! Convert version numbers to string
//! Convert version numbers to string
#define _STR(S) #S
#define _STR(S) #S
...
...
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