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
057ab7f50418f128513ac7e16dbd12bc563bc224
1 parent
30a8ec2a
更新订单状态接口二合一
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
library/LibModels/Web/Product/PayData.php
yohobuy/m.yohobuy.com/application/modules/Shopping/controllers/Pay.php
yohobuy/www.yohobuy.com/application/models/Shopping/Pay.php
yohobuy/www.yohobuy.com/application/models/Shopping/Payment.php
library/LibModels/Web/Product/PayData.php
View file @
057ab7f
...
...
@@ -218,5 +218,26 @@ class PayData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/**
* 更新订单状态-未付款更新已付款状态
* @param type int $orderCode 订单号
* @param type int $paymentCode 支付方式
* @param type int $totalFee 金额
* @return type []
*/
public
static
function
pcpayNotify
(
$orderCode
,
$paymentCode
,
$totalFee
)
{
$param
=
Yohobuy
::
param
();
$param
[
'client_type'
]
=
'web'
;
$param
[
'private_key'
]
=
Yohobuy
::
$privateKeyList
[
'web'
];
$param
[
'method'
]
=
'web.SpaceOrders.pcpayNotify'
;
$param
[
'orderCode'
]
=
$orderCode
;
$param
[
'paymentCode'
]
=
$paymentCode
;
$param
[
'totalFee'
]
=
$totalFee
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
}
\ No newline at end of file
...
...
yohobuy/m.yohobuy.com/application/modules/Shopping/controllers/Pay.php
View file @
057ab7f
...
...
@@ -68,7 +68,7 @@ class PayController extends AbstractAction
// 此处是咨询过JAVA开发任明明,按照老代码的实现方式判断,更新支付方式
$paymentRecod
=
OrderData
::
updateOrderPayment
(
$orderCode
,
2
,
$uid
);
if
(
empty
(
$paymentRecod
)
||
$paymentRecod
[
'code'
]
!=
200
)
{
$this
->
helpJsRedirect
(
'系统繁忙,请稍后再试'
);
$this
->
helpJsRedirect
(
isset
(
$paymentRecod
[
'message'
])
?
$paymentRecod
[
'message'
]
:
'系统繁忙,请稍后再试'
);
break
;
}
...
...
yohobuy/www.yohobuy.com/application/models/Shopping/Pay.php
View file @
057ab7f
...
...
@@ -337,7 +337,7 @@ class PayModel
$paymentRecod
=
OrderData
::
updateOrderPayment
(
$orderCode
,
$payId
,
$uid
);
if
(
empty
(
$paymentRecod
)
||
$paymentRecod
[
'code'
]
!=
200
)
{
$result
[
'error'
]
=
true
;
$result
[
'message'
]
=
'系统繁忙,请稍后再试'
;
$result
[
'message'
]
=
isset
(
$paymentRecod
[
'message'
])
?
$paymentRecod
[
'message'
]
:
'系统繁忙,请稍后再试'
;
break
;
}
$bankRecord
=
PayData
::
getBankByOrder
(
$orderCode
);
...
...
yohobuy/www.yohobuy.com/application/models/Shopping/Payment.php
View file @
057ab7f
...
...
@@ -130,13 +130,8 @@ class PaymentModel
// 无需付款
if
(
isset
(
$order
[
"payment_amount"
])
&&
$order
[
"payment_amount"
]
==
0
)
{
// ERP提交订单状态
PayData
::
submitOrderStatus
(
$orderCode
,
0
,
''
,
''
,
0
,
''
,
''
,
''
);
// 更新订单的状态
PayData
::
updateOrderStatus
(
$order
[
'order_id'
],
$uid
,
0
,
'Y'
,
''
);
//更新订单状态
PayData
::
pcpayNotify
(
$orderCode
,
0
,
0
);
$result
[
'notNeedPay'
]
=
true
;
break
;
}
...
...
@@ -332,7 +327,6 @@ class PaymentModel
$firstGoods
=
current
(
$orderData
[
'order_goods'
]);
self
::
$code
=
array
(
'code'
=>
200
,
'message'
=>
'支付成功,请等待发货'
,
'orderNum'
=>
$orderData
[
'order_code'
],
'amount'
=>
$orderData
[
'payment_amount'
],
'address'
=>
$orderData
[
'address'
],
...
...
Please
register
or
login
to post a comment