From c059df525c4b4f71d6013b38b016f4bcf7498a83 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 24 Jun 2024 16:53:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=85=85=E5=80=BC=E4=BC=9A=E5=91=98API=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/store/StoreController.php | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index 6a2b27056..6b22108b6 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -99,6 +99,32 @@ class StoreController extends BaseApiController return $this->success('支付成功', ['out_trade_no' => $result['out_trade_no'], 'pay_type' => PayEnum::WECHAT_PAY_BARCODE, 'transaction_id' => $result['transaction_id']]); } + /** + * 重新充值会员 + */ + public function again_recharge() + { + $auth_code = $this->request->post('auth_code'); //微信支付条码 + $id = $this->request->post('id',0); //id + $order = UserRecharge::where('id', $id)->where('paid',0)->find(); + if(!$order){ + return $this->fail('订单不存在'); + } + $order['pay_price']=$order['price']; + $result = PaymentLogic::codepay($auth_code, $order,'条码支付'); + if (PaymentLogic::hasError()) { + return $this->fail(PaymentLogic::getError()); + } + if (isset($result['trade_state_desc']) && $result['trade_state_desc'] == '支付成功') { + PayNotifyLogic::handle('recharge', $result['out_trade_no'], $result); + } else { + Redis::send('send-code-pay', ['order_id' => $order['order_id'],'pay_type'=>'recharge']); + return $this->success('用户支付中'); + } + return $this->success('支付成功', ['out_trade_no' => $result['out_trade_no'], 'pay_type' => PayEnum::WECHAT_PAY_BARCODE, 'transaction_id' => $result['transaction_id']]); + } + + /** * 门店会员充值数量 */