Sfoglia il codice sorgente

fix(payment): 解决支付宝支付重复提交问题

- 添加订单支付状态检查防止重复支付
- 在支付前验证订单是否已被支付
- 返回相应错误信息提示用户订单已支付
shichen 3 mesi fa
parent
commit
387c826c72
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      app/controller/api/AliPay.php

+ 3 - 0
app/controller/api/AliPay.php

@@ -26,6 +26,9 @@ class AliPay
26 26
         if (!$groupOrder) {
27 27
             return app('json')->fail('订单不存在');
28 28
         }
29
+        if ($groupOrder['paid'] == 1) {
30
+            return app('json')->fail('订单已支付');
31
+        }
29 32
         $access = new Access();
30 33
         $res = $access->pay_huifu('ALI','',$groupOrder,'支付宝支付',env('APP_URL')."/api/hf_notify/pay");
31 34
         return app('json')->success($res);