正在显示
1 个修改的文件
包含
16 行增加
和
1 行删除
| @@ -89,6 +89,21 @@ class Order extends Backend | @@ -89,6 +89,21 @@ class Order extends Backend | ||
| 89 | $notifyurl = 'https://wyc.tenyes.cn/api/index/refundNotifyx';//退款回调地址 | 89 | $notifyurl = 'https://wyc.tenyes.cn/api/index/refundNotifyx';//退款回调地址 |
| 90 | //直接调用退款方法传参即可 | 90 | //直接调用退款方法传参即可 |
| 91 | $response = \addons\epay\library\Service::submitRefund($pay_fee, $refund_fee, $order_sn, getRefundSn($order['user_id']), $pay_type, $reason, $notifyurl, '', 'miniapp'); | 91 | $response = \addons\epay\library\Service::submitRefund($pay_fee, $refund_fee, $order_sn, getRefundSn($order['user_id']), $pay_type, $reason, $notifyurl, '', 'miniapp'); |
| 92 | - print_r($response);return; | 92 | + $response = json_encode($response); |
| 93 | + $response = json_decode($response, true); | ||
| 94 | + file_put_contents("pcl_repay_v2.log", date("Y-m-d H:i:s") . "::" . json_encode($response, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND); | ||
| 95 | + if (!empty($response['return_code'] == 'SUCCESS')) { | ||
| 96 | + //退款成功,更新退款记录 | ||
| 97 | + $relogs['update_time'] = time(); | ||
| 98 | + $relogs['is_pay'] = 3; | ||
| 99 | + $relogs['out_refund_no'] = $response['out_refund_no']; | ||
| 100 | + $relogs['refund_time'] = time(); | ||
| 101 | + $rs2 = Db::name('order') | ||
| 102 | + ->where(['id' => $order['id']]) | ||
| 103 | + ->update($relogs); | ||
| 104 | + } else { | ||
| 105 | + //$this->error('退款失败'); | ||
| 106 | + } | ||
| 107 | + $this->success(); | ||
| 93 | } | 108 | } |
| 94 | } | 109 | } |
-
请 注册 或 登录 后发表评论