Commit 0eff903c by 郑建康(PHP)

修复慧收钱退费模块返回数据

1 parent b5654469
...@@ -51,12 +51,9 @@ abstract class HsqBaseStrategy implements BaseStrategy ...@@ -51,12 +51,9 @@ abstract class HsqBaseStrategy implements BaseStrategy
} }
$body = http_build_query($body); $body = http_build_query($body);
if (empty($body)) throw new PayException('支付数据异常'); if (empty($body)) throw new PayException('支付数据异常');
$response = $this->curlPost($body, $url); $response = $this->curlPost($body, $url);
if ($response['error']) throw new PayException('网络发生错误,请稍后再试curl返回码:' . $response['message']); if ($response['error']) throw new PayException('网络发生错误,请稍后再试curl返回码:' . $response['message']);
$retData = json_decode($response['body'],true); $retData = json_decode($response['body'],true);
$result = json_decode($retData['result'],true); $result = json_decode($retData['result'],true);
if($result['orderStatus'] == 'FAIL') throw new PayException('支付平台返回错误提示:' . $result['respMsg']); if($result['orderStatus'] == 'FAIL') throw new PayException('支付平台返回错误提示:' . $result['respMsg']);
......
...@@ -46,15 +46,7 @@ class HsqRefund extends HsqBaseStrategy ...@@ -46,15 +46,7 @@ class HsqRefund extends HsqBaseStrategy
*/ */
protected function retData(array $data) protected function retData(array $data)
{ {
$backData = [ $backData = json_decode($data['result'] ,true);
'order_type' => $data['order_type'] ?? '', //订单类型
'order_no' => $data['mchnt_order_no'] ?? '', //原交易商户订单号
'refund_no' => $data['refund_order_no'] ?? '', //商户退款单号
'out_trade_no' => $data['transaction_id'] ?? '', //渠道交易流水号
'out_refund_no' => $data['refund_id'] ?? '', //渠道撤销流水号
'refund_fee' => $data['reserved_refund_amt'] ?? 0, //退款金额
'other' => $data
];
return $backData; return $backData;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!