退款回调

This commit is contained in:
chenbo 2023-11-21 17:37:10 +08:00
parent 8a13c51491
commit bc31d0dcbe
1 changed files with 2 additions and 1 deletions

View File

@ -277,8 +277,9 @@ class WeChatPayMerchantService extends BasePayService
// 退款通知
$server->handleRefunded(function (Message $message) {
\think\facade\Log::info(['退款回调信息', $message]);
\think\facade\Log::info(['退款回调信息', $message['refund_status']]);
if($message['refund_status'] === 'SUCCESS') {
$refundOrder = RefundOrder::where(['out_trade_no'=>$message['out_trade_no'], 'refund_sn'=>$message['out_refund_no']])->find();
$refundOrder = RefundOrder::where(['order_sn'=>$message['out_trade_no'], 'refund_sn'=>$message['out_refund_no']])->find();
// 防止重复操作
if ($refundOrder['refund_status'] == 1 && !empty($refundOrder['refund_id'])) {
return true;