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
14b85320
Commit
14b85320
authored
Sep 11, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修复日志重新打印Bug。2. 修改支付时的等待语。 3. 取消支付后,三次冲正的超时时间设置为19秒,总时间接近60秒。
parent
a2f3213e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
71 deletions
+31
-71
sbkpay/control.cpp
+1
-1
sbkpay/hostwidget.cpp
+1
-1
sbkpay/main.cpp
+28
-68
sbkpay/version.h
+1
-1
No files found.
sbkpay/control.cpp
View file @
14b85320
...
...
@@ -598,7 +598,7 @@ void Control::Request(ReqType type, QStringList list)
while
(
i
<
3
)
{
if
(
_posType
==
SPCC
)
{
if
((
tmpflag
=
SendMessageToSBKAPI
(
tmpjson
,
tmparray
,
tmperror
,
1
5
,
true
))
==
true
)
{
if
((
tmpflag
=
SendMessageToSBKAPI
(
tmpjson
,
tmparray
,
tmperror
,
1
9
,
true
))
==
true
)
{
break
;
}
}
else
{
...
...
sbkpay/hostwidget.cpp
View file @
14b85320
...
...
@@ -146,7 +146,7 @@ void HostWidget::ShowPayWidget()
if
(
_type
==
pay
)
{
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"支付
宝支付中...
"
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"支付
中/等待用户输入密码
"
));
_intertime
.
start
(
2
*
1000
);
emit
RequestWithType
(
pay
,
list
);
}
...
...
sbkpay/main.cpp
View file @
14b85320
...
...
@@ -21,46 +21,41 @@
EXTERN_C
IMAGE_DOS_HEADER
__ImageBase
;
static
bool
CopyApiDll
(
QString
&
errorString
)
static
void
InitLogger
(
)
{
// char path[MAX_PATH] = {0};
// ToolS::GetProcPath(path);
QString
localDllPath
=
QString
::
fromLocal8Bit
(
"%1/StarbucksAPI.dll"
).
arg
(
qApp
->
applicationDirPath
());
QFileInfo
localFileInfo
(
localDllPath
);
char
path
[
MAX_PATH
]
=
{
0
};
ToolS
::
GetProcPath
(
path
);
FMPSettings
setting
;
QString
configDllPath
=
setting
.
GetValue
(
CONFIG_OLTP_PATH
,
"C:
\\
OLTP
\\
"
).
toString
();
Q
FileInfo
configFileInfo
(
configDllPath
);
if
(
!
configFileInfo
.
isFile
()
)
{
configFileInfo
=
QFileInfo
(
configDllPath
+
"/StarbucksAPI.dll"
)
;
QString
logPath
=
setting
.
GetValue
(
CONFIG_LOG_PATH
,
QString
(
path
)
+
"/log
"
).
toString
();
Q
String
logName
=
setting
.
GetValue
(
CONFIG_LOG_NAME
,
"sbuxpay.txt"
).
toString
(
);
QsLogging
::
Level
logLevel
=
(
QsLogging
::
Level
)
setting
.
GetValue
(
CONFIG_LOG_LEVEL
,
0
).
toInt
();
if
(
logLevel
<
QsLogging
::
TraceLevel
||
logLevel
>
QsLogging
::
OffLevel
)
{
logLevel
=
QsLogging
::
TraceLevel
;
}
int
logSize
=
setting
.
GetValue
(
CONFIG_LOG_SIZE
,
1
).
toInt
();
int
logCount
=
setting
.
GetValue
(
CONFIG_LOG_COUNT
,
5
).
toInt
();
if
(
!
configFileInfo
.
exists
())
{
errorString
=
"Config dll path: "
+
configDllPath
+
" does not exist."
;
QLOG_ERROR
()
<<
errorString
;
return
false
;
QDir
logDir
(
logPath
);
if
(
!
logDir
.
exists
())
{
logDir
.
mkpath
(
logDir
.
absolutePath
());
}
QString
logFilePath
=
logDir
.
absolutePath
()
+
'/'
+
logName
;
QsLogging
::
Logger
&
logger
=
QsLogging
::
Logger
::
instance
();
logger
.
setLoggingLevel
(
logLevel
);
if
(
!
localFileInfo
.
exists
()
||
localFileInfo
.
lastModified
()
<
configFileInfo
.
lastModified
())
{
QFile
localDllFile
(
localFileInfo
.
absoluteFilePath
());
if
(
localDllFile
.
exists
())
{
localDllFile
.
remove
();
}
QFile
configDllFile
(
configFileInfo
.
absoluteFilePath
());
if
(
!
configDllFile
.
copy
(
localDllPath
))
{
errorString
=
"Can't copy StarbucksAPI.dll: "
+
configDllFile
.
errorString
();
QLOG_ERROR
()
<<
errorString
;
return
false
;
}
}
/* 配置输出定向器 */
QsLogging
::
DestinationPtr
fileDestination
(
QsLogging
::
DestinationFactory
::
MakeFileDestination
(
logFilePath
,
QsLogging
::
EnableLogRotation
,
QsLogging
::
MaxSizeBytes
(
1024
*
1024
*
logSize
),
QsLogging
::
MaxOldLogCount
(
logCount
)));
logger
.
addDestination
(
fileDestination
);
return
true
;
QsLogging
::
DestinationPtr
consleDest
(
QsLogging
::
DestinationFactory
::
MakeDebugOutputDestination
());
logger
.
addDestination
(
consleDest
);
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstance
,
DWORD
dwReason
,
LPVOID
/*lpvReserved*/
)
{
static
bool
ownApplication
=
FALSE
;
...
...
@@ -85,6 +80,9 @@ BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpvReserved*/
QApplication
::
addLibraryPath
(
configPath
);
qDebug
()
<<
"Library paths: "
<<
QApplication
::
libraryPaths
()
<<
configPath
;
InitLogger
();
ownApplication
=
QMfcApp
::
pluginInstance
(
hInstance
);
}
if
(
dwReason
==
DLL_PROCESS_DETACH
&&
ownApplication
)
...
...
@@ -98,48 +96,10 @@ extern "C" __declspec(dllexport) void Start(const char *indata, char *outdata)
HWND
parent
=
GetDesktopWindow
();
QWinWidget
win
(
parent
);
char
path
[
MAX_PATH
]
=
{
0
};
ToolS
::
GetProcPath
(
path
);
FMPSettings
setting
;
QString
logPath
=
setting
.
GetValue
(
CONFIG_LOG_PATH
,
QString
(
path
)
+
"/log"
).
toString
();
QString
logName
=
setting
.
GetValue
(
CONFIG_LOG_NAME
,
"sbuxpay.txt"
).
toString
();
QsLogging
::
Level
logLevel
=
(
QsLogging
::
Level
)
setting
.
GetValue
(
CONFIG_LOG_LEVEL
,
0
).
toInt
();
if
(
logLevel
<
QsLogging
::
TraceLevel
||
logLevel
>
QsLogging
::
OffLevel
)
{
logLevel
=
QsLogging
::
TraceLevel
;
}
int
logSize
=
setting
.
GetValue
(
CONFIG_LOG_SIZE
,
1
).
toInt
();
int
logCount
=
setting
.
GetValue
(
CONFIG_LOG_COUNT
,
5
).
toInt
();
QDir
logDir
(
logPath
);
if
(
!
logDir
.
exists
())
{
logDir
.
mkpath
(
logDir
.
absolutePath
());
}
QString
logFilePath
=
logDir
.
absolutePath
()
+
'/'
+
logName
;
QsLogging
::
Logger
&
logger
=
QsLogging
::
Logger
::
instance
();
logger
.
setLoggingLevel
(
logLevel
);
/* 配置输出定向器 */
QsLogging
::
DestinationPtr
fileDestination
(
QsLogging
::
DestinationFactory
::
MakeFileDestination
(
logFilePath
,
QsLogging
::
EnableLogRotation
,
QsLogging
::
MaxSizeBytes
(
1024
*
1024
*
logSize
),
QsLogging
::
MaxOldLogCount
(
logCount
)));
logger
.
addDestination
(
fileDestination
);
QsLogging
::
DestinationPtr
consleDest
(
QsLogging
::
DestinationFactory
::
MakeDebugOutputDestination
());
logger
.
addDestination
(
consleDest
);
// QString errorString;
// if(!CopyApiDll(errorString)) {
// errorString = QString::fromLocal8Bit("{\"statusCode\":23, \"message\":\"%1\"}").arg(errorString);
// strcpy(outdata, errorString.toLocal8Bit());
// return;
// }
static
RollBack
rollback
;
Control
control
(
&
win
);
control
.
Start
(
indata
,
outdata
);
static
RollBack
rollback
;
if
(
!
rollback
.
isRunning
())
rollback
.
start
();
}
...
...
sbkpay/version.h
View file @
14b85320
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD
38
#define VER_BUILD
40
//! Convert version numbers to string
#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