Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qfmclient
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
shuai.liu
qfmclient
Commits
81dd0ace
Commit
81dd0ace
authored
Nov 24, 2017
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 设置门店信息、非码支付、支付查询、支付退款接口测试ok
parent
34dfc7cf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
qfmclient.cpp
+0
-0
qfmclient.h
+19
-11
No files found.
qfmclient.cpp
View file @
81dd0ace
This diff is collapsed.
Click to expand it.
qfmclient.h
View file @
81dd0ace
...
@@ -12,18 +12,20 @@
...
@@ -12,18 +12,20 @@
#define MAX_REQ_COUNT 25600
#define MAX_REQ_COUNT 25600
#define ROLL_BACK_FILE_NAME "fmclient.rbk"
#define ROLL_BACK_FILE_NAME "fmclient.rbk"
#define SET_STORE_INFO 1000 //设置门店信息
#define FREEMUD_PAY 10031 //非码支付
#define QUERY_PAY 10030 //支付查询
#define REFUND_PAY 10041 //支付退款
class
QFmClient
:
public
QThread
class
QFmClient
:
public
QThread
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
QFmClient
(
QObject
*
parent
=
NULL
);
QFmClient
(
QObject
*
parent
=
NULL
);
void
run
();
void
run
();
bool
Init
(
QString
proxy_IP
,
unsigned
short
proxy_port
,
unsigned
short
listen_prot
,
unsigned
short
long_timeout
,
unsigned
short
short_timeout
);
bool
Init
(
QString
proxy_IP
,
unsigned
short
proxy_port
,
unsigned
short
listen_prot
,
unsigned
short
long_timeout
,
unsigned
short
short_timeout
);
bool
InitStoreInfo
();
signals
:
signals
:
void
Error
(
QString
error
);
void
Error
(
QString
error
);
private
:
private
:
...
@@ -36,9 +38,17 @@ private:
...
@@ -36,9 +38,17 @@ private:
void
WaitAndSleep
(
int
elapse
);
void
WaitAndSleep
(
int
elapse
);
bool
WaitForConnectReqFromPos
();
bool
WaitForConnectReqFromPos
();
int
ProcessPosReqData
(
QJsonObject
&
object
);
int
ProcessPosReqData
(
QJsonObject
&
object
);
bool
ConvertJsonFormat
(
QJsonObject
&
object
);
//convert pos requst json format from 非码支付插件 API 对接说明.pdf to 非码支付FMClient商户版_20170921.pdf
bool
ConvertRequestJsonFormat
(
QJsonObject
&
object
);
//convert pos request json format from 非码支付插件 API 对接说明.pdf to 非码支付FMClient商户版_20170921.pdf
void
GetStoreInfo
(
QJsonObject
&
object
);
//获取门店信息
bool
ConvertResponseJsonFormat
(
QJsonObject
&
object
,
int
nType
);
void
sendResponseToPos
(
int
nflag
);
void
SetStoreInfo
(
QJsonObject
&
object
);
//设置门店信息
void
FreemudPay
(
QJsonObject
&
object
);
//非码支付
bool
QueryPay
(
QJsonObject
&
object
);
//支付查询
bool
RefundPay
(
QJsonObject
&
object
);
//支付退款
bool
FreemudPayResponse
(
QJsonObject
&
object
);
//非码支付回复处理
bool
QueryPayResponse
(
QJsonObject
&
object
);
//支付查询回复处理
bool
RefundPayResponse
(
QJsonObject
&
object
);
//支付退款回复处理
void
sendSetResponseToPos
(
bool
bFlag
);
void
AddReqCount
(
QJsonObject
&
object
);
void
AddReqCount
(
QJsonObject
&
object
);
int
CheckIsCompleteJsonData
(
int
*
count
,
char
*
data
);
int
CheckIsCompleteJsonData
(
int
*
count
,
char
*
data
);
int
RecvSockData
(
int
sock
,
char
*
buffer
,
int
length
);
int
RecvSockData
(
int
sock
,
char
*
buffer
,
int
length
);
...
@@ -51,17 +61,15 @@ private:
...
@@ -51,17 +61,15 @@ private:
char
*
EncodeSendData
(
char
*
buf
,
int
length
,
int
*
eLength
);
char
*
EncodeSendData
(
char
*
buf
,
int
length
,
int
*
eLength
);
int
SendData2ZhProxyAndWaitRspData
();
int
SendData2ZhProxyAndWaitRspData
();
int
RecvAndCheckDataFromSock
(
int
sock
,
int
flag
,
int
type
);
int
RecvAndCheckDataFromSock
(
int
sock
,
int
flag
,
int
type
);
int
ProcessZhProxyRspDataAndSend2Pos
();
int
ProcessZhProxyRspDataAndSend2Pos
(
int
nType
);
int
CheckRecvedData
();
int
CheckRecvedData
();
void
BackupPosReq
(
char
*
req
);
void
BackupPosReq
(
char
*
req
);
private
:
private
:
bool
_endflag
;
bool
_endflag
;
char
_recvbuf
[
MAX_BUF_LEN
];
char
_recvbuf
[
MAX_BUF_LEN
];
char
_tempbuf
[
MAX_BUF_LEN
];
char
_tempbuf
[
MAX_BUF_LEN
];
char
_sendbuf
[
MAX_BUF_LEN
];
char
_sendbuf
[
MAX_BUF_LEN
];
char
_codeBuf
[
MAX_BUF_LEN
];
char
_codeBuf
[
MAX_BUF_LEN
];
unsigned
char
_codeKey
[
MAX_CODE_KEY
];
unsigned
char
_codeKey
[
MAX_CODE_KEY
];
...
...
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