Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
payment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8a31b18b
authored
Mar 29, 2019
by
yeran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update some bugs
1 parent
9d5b9d71
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
examples/sw/liteCharge.php
src/Common/BaseData.php
src/Common/Sw/SwBaseStrategy.php
src/Common/SwConfig.php
examples/sw/liteCharge.php
View file @
8a31b18
...
...
@@ -15,6 +15,8 @@ $config = json_decode($configStr,true);
$payDataStr
=
"
{
\"terminal_trace\":\"20190327151722366145505357545320\",\"total_fee\":1,\"order_body\":\"支付测试\",\"open_id\":\"oUlAM0Wp1K1rJEGJ0t__Ls5-qFKE\",\"attach\":\"10054c238f670a2e9649a8b100f20562\"
}
"
;
$payData
=
json_decode
(
$payDataStr
,
true
);
$config
[
'base_url'
]
=
'https://pay.lcsw.cn/lcsw'
;
try
{
$ret
=
Charge
::
run
(
Config
::
SW_CHANNEL_LITE
,
$config
,
$payData
);
}
catch
(
PayException
$e
)
{
...
...
src/Common/BaseData.php
View file @
8a31b18
...
...
@@ -61,7 +61,6 @@ abstract class BaseData
$this
->
data
=
array_merge
(
$config
->
toArray
(),
$reqData
);
//配置信息合并
try
{
$this
->
checkDataParam
();
}
catch
(
PayException
$e
)
{
...
...
src/Common/Sw/SwBaseStrategy.php
View file @
8a31b18
...
...
@@ -91,11 +91,13 @@ abstract class SwBaseStrategy implements BaseStrategy
*/
protected
function
getReqUrl
(
$url
=
null
)
{
if
(
!
empty
(
$this
->
base_url
)){
$_pre
=
$this
->
base_url
;
if
(
isset
(
$this
->
config
->
base_url
)
&&
!
empty
(
$this
->
config
->
base_url
)){
$_pre
=
$this
->
config
->
base_url
;
}
else
{
$_pre
=
SwConfig
::
BASE_URL
;
}
die
(
$_pre
);
return
$_pre
.
(
$url
??
SwConfig
::
UNIFIED_URL
);
}
...
...
src/Common/SwConfig.php
View file @
8a31b18
...
...
@@ -31,7 +31,7 @@ final class SwConfig extends ConfigInterface
public
$notify_url
;
const
BASE_URL
=
'http://test.lcsw.cn:8045/lcsw'
;
const
BASE_URL
=
'http
s://pay.lcsw.cn/lcsw'
;
// 'http
://test.lcsw.cn:8045/lcsw';
const
UNIFIED_URL
=
'/pay/100/jspay'
;
// 公众号支付统一下单url
...
...
@@ -136,6 +136,10 @@ final class SwConfig extends ConfigInterface
$this
->
access_token
=
trim
(
$config
[
'access_token'
]);
}
if
(
key_exists
(
'base_url'
,
$config
))
{
$this
->
base_url
=
trim
(
$config
[
'base_url'
]);
}
// 设置交易开始时间 格式为yyyyMMddHHmmss,在次之前一定要设置时区
$startTime
=
time
();
$this
->
terminal_time
=
date
(
'YmdHis'
,
$startTime
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment