From 866387c698b0ed6a4108d2ea6605de8a152d413e Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Tue, 7 Mar 2023 18:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=80=80=E6=AC=BE=E5=9B=9E?= =?UTF-8?q?=E8=B0=83url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/UserController.php | 4 +-- app/Model/OrderInquiryRefund.php | 60 +++++++++++++++++++++++++++++++ extend/Wechat/WechatPay.php | 2 +- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 app/Model/OrderInquiryRefund.php diff --git a/app/Controller/UserController.php b/app/Controller/UserController.php index c98034d..2630977 100644 --- a/app/Controller/UserController.php +++ b/app/Controller/UserController.php @@ -110,8 +110,8 @@ class UserController extends AbstractController $options['out_refund_no'] = $order_inquiry['inquiry_refund_no']; $options['reason'] = "退款原因"; $options['amount'] = [ - 'refund' => 0.01 * 100, - 'total' => 0.01 * 100, + 'refund' => (int)1, + 'total' => (int)1, 'currency' => "CNY", ]; diff --git a/app/Model/OrderInquiryRefund.php b/app/Model/OrderInquiryRefund.php new file mode 100644 index 0000000..c37a99c --- /dev/null +++ b/app/Model/OrderInquiryRefund.php @@ -0,0 +1,60 @@ +first($fields); + } + + /** + * 获取信息-多条 + * @param array $params + * @param array $fields + * @return object|null + */ + public static function getList(array $params, array $fields = ['*']): object|null + { + return self::where($params)->get($fields); + } +} diff --git a/extend/Wechat/WechatPay.php b/extend/Wechat/WechatPay.php index 5765ea8..7ebd94b 100644 --- a/extend/Wechat/WechatPay.php +++ b/extend/Wechat/WechatPay.php @@ -179,7 +179,7 @@ class WechatPay $app = $this->createApp(); $options['notify_url'] = env('DOMAIN_NAME_DEV') . $this->config['refund_notify_url']; - + dump($options);die; $response = $app->getClient()->postJson("v3/refund/domestic/refunds", $options); if ($response->isFailed()) { // 出错了,处理异常