退款回调
This commit is contained in:
parent
0e95637a2b
commit
ce9590b4ec
|
@ -244,6 +244,7 @@ class WeChatPayMerchantService extends BasePayService
|
|||
if (empty($order)) {
|
||||
throw new Exception('回调订单不存在');
|
||||
}
|
||||
// 防止重复操作
|
||||
if ($order['pay_status'] == PayOrderEnum::PAY_STATUS_ISPAID && !empty($order['transaction_id'])) {
|
||||
return true;
|
||||
}
|
||||
|
@ -278,6 +279,10 @@ class WeChatPayMerchantService extends BasePayService
|
|||
\think\facade\Log::info(['退款回调信息', $message]);
|
||||
if($message['refund_status'] === 'SUCCESS') {
|
||||
$refundOrder = RefundOrder::where(['out_trade_no', $message['out_trade_no'], 'refund_sn'=>$message['out_refund_no']])->find();
|
||||
// 防止重复操作
|
||||
if ($refundOrder['refund_status'] == 1 && !empty($order['refund_id'])) {
|
||||
return true;
|
||||
}
|
||||
$refundOrder->refund_status = 1;
|
||||
$refundOrder->refund_id = $message['refund_id'];
|
||||
$refundOrder->finish_time = time();
|
||||
|
|
Loading…
Reference in New Issue