|
@@ -420,6 +420,7 @@ class RefundController extends Curd
|
|
|
return json_fail("退款金额不能超过支付金额");
|
|
|
}
|
|
|
$payDetail = PayDetail::where('join_pay_order_id', $order->order_groupby)
|
|
|
+ ->whereJsonContains('join_pay_object_json->order_id', $orderId)
|
|
|
->where('pay_status', 'SUCCESS')
|
|
|
->whereIn('pay_category', ['GOODS', 'SERVICE', 'CHNMED', 'CHNNCD', 'MEALS', 'DISHES', 'VIP', 'PACKAGE'])
|
|
|
->get()
|
|
@@ -647,13 +648,17 @@ class RefundController extends Curd
|
|
|
];
|
|
|
$res = Pay::wechat(config('payment.wxpay'))->refund($data);
|
|
|
$resArray = json_decode($res, true);
|
|
|
- if (!$resArray['result_code'] == 'SUCCESS' || !$resArray['return_code'] == 'SUCCESS') {
|
|
|
+ if ($resArray['result_code'] != 'SUCCESS' || $resArray['return_code'] != 'SUCCESS') {
|
|
|
Log::channel('pay')->error('WXPAY_REFUND_FAIL', $resArray);
|
|
|
throw new BusinessException("退款失败");
|
|
|
}
|
|
|
|
|
|
+ Log::info("退款响应", $resArray);
|
|
|
+
|
|
|
return $resArray;
|
|
|
} catch (\Exception $e) {
|
|
|
+ Log::error("微信退款失败", ['msg' => $e->getMessage()]);
|
|
|
+
|
|
|
throw new BusinessException("退款失败");
|
|
|
}
|
|
|
}
|