1
This commit is contained in:
parent
0fc0b46a04
commit
e2847b5079
@ -271,20 +271,21 @@ class WechatPay
|
|||||||
$url = "v3/pay/transactions/out-trade-no/" . $out_trade_no . "/close";
|
$url = "v3/pay/transactions/out-trade-no/" . $out_trade_no . "/close";
|
||||||
|
|
||||||
$response = $app->getClient()->postJson($url, $options);
|
$response = $app->getClient()->postJson($url, $options);
|
||||||
if ($response->isFailed()) {
|
if (!empty($response)){
|
||||||
// 出错了,处理异常
|
if ($response->isFailed()) {
|
||||||
$result = $response->toArray(false);
|
// 出错了,处理异常
|
||||||
Log::getInstance()->info(json_encode($result,JSON_UNESCAPED_UNICODE));
|
$result = $response->toArray(false);
|
||||||
if(empty($result)){
|
if(empty($result)){
|
||||||
// 返回值为空
|
// 返回值为空
|
||||||
throw new BusinessException("发起支付失败");
|
throw new BusinessException("关闭支付订单失败");
|
||||||
}
|
}
|
||||||
if (!empty($result['code'])){
|
if (!empty($result['code'])){
|
||||||
if ($result['code'] != 400){
|
if ($result['code'] != 400){
|
||||||
throw new BusinessException($result['message']);
|
throw new BusinessException($result['message']);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
throw new BusinessException("关闭支付订单失败");
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
throw new BusinessException("关闭支付订单失败");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user