Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
9 years ago
Commit
e548232a4400e1579e5e9845f3ac863d2cf422f0
1 parent
d302ccdd
微信 支付加到期时间
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
yohobuy/www.yohobuy.com/application/models/Shopping/Payment.php
yohobuy/www.yohobuy.com/application/models/Shopping/Payment.php
View file @
e548232
...
...
@@ -325,14 +325,28 @@ class PaymentModel
$input
->
SetBody
(
'有货订单号:'
.
$orderCode
);
$input
->
SetOut_trade_no
(
'YOHOBuy_'
.
$orderCode
);
// 商户订单号
$input
->
SetTotal_fee
(
$totalFee
);
$input
->
SetTime_start
(
date
(
"YmdHis"
));
$input
->
SetTime_expire
(
date
(
"YmdHis"
,
time
()
+
600
));
//到期时间
if
(
!
empty
(
$orderDetail
[
'data'
][
'pay_expire'
])
&&
(
$payExpireTime
=
strtotime
(
$orderDetail
[
'data'
][
'pay_expire'
])))
{
$payExpireTime
=
$payExpireTime
;
}
else
{
$payExpireTime
=
time
();
}
$input
->
SetTime_start
(
date
(
"YmdHis"
,
strtotime
(
'-2 hours'
,
$payExpireTime
)));
//最短失效时间间隔必须大于5分钟 [https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_1]
$input
->
SetTime_expire
(
date
(
"YmdHis"
,
$payExpireTime
+
300
));
$input
->
SetTrade_type
(
"NATIVE"
);
$input
->
SetProduct_id
(
$orderCode
);
$notify
=
new
WxPayNativePay
();
$payResult
=
$notify
->
GetPayUrl
(
$input
);
//错误信息,EQ:超时
if
(
!
empty
(
$payResult
[
'return_code'
])
&&
$payResult
[
'return_code'
]
===
'FAIL'
)
{
self
::
$code
[
'message'
]
=
$payResult
[
'return_msg'
];
break
;
}
if
(
$payResult
[
'result_code'
]
===
'FAIL'
)
{
//错误信息,EQ:多次涮新
if
(
!
empty
(
$payResult
[
'result_code'
])
&&
$payResult
[
'result_code'
]
===
'FAIL'
)
{
self
::
$code
[
'message'
]
=
$payResult
[
'err_code_des'
];
break
;
}
...
...
Please
register
or
login
to post a comment