|
|
@@ -695,7 +695,7 @@ class PaymentService extends BaseService
|
|
|
$orderInfo['remark'] = $this->error;
|
|
|
$orderInfo['out_trade_no'] = '';
|
|
|
$refundStatus = PaymentService::make()->refund($orderInfo,'pay');
|
|
|
- if(!PayOrdersModel::where(['id'=>$orderId])->update(['refund_status'=> $refundStatus?1:3,'refund_remark'=>PaymentService::make()->getError(),'refund_money'=>$refundStatus?$refundAmount:0,'update_time'=>time()])){
|
|
|
+ if(!PayOrdersModel::where(['id'=>$orderId])->update(['refund_status'=> $refundStatus?1:3,'refund_remark'=>json_encode(['msg'=>$this->error,'data'=>$this->errorData],256),'refund_money'=>$refundStatus?$refundAmount:0,'update_time'=>time()])){
|
|
|
$this->saveLog("caches:payments:payNotify_{$productId}:notify_{$out_trade_num}_error", ['error'=>$this->error,'order' => $orderInfo, 'notify' => $data]);
|
|
|
$this->error = '订单退款状态更新错误~';
|
|
|
DB::rollBack();
|
|
|
@@ -779,6 +779,7 @@ class PaymentService extends BaseService
|
|
|
$refundStatus = true;
|
|
|
} else {
|
|
|
DB::rollBack();
|
|
|
+ $this->errorData = $data;
|
|
|
$this->error = '微信退款处理失败:'.$pay->message;
|
|
|
return false;
|
|
|
}
|
|
|
@@ -796,6 +797,7 @@ class PaymentService extends BaseService
|
|
|
if ($payResult->code == 10000 || intval($payResult->code) == 40004) {
|
|
|
$refundStatus = true;
|
|
|
} else {
|
|
|
+ $this->errorData = $data;
|
|
|
$this->error = '支付宝退款处理失败:'.$payResult->code;
|
|
|
return false;
|
|
|
}
|