Browse Source

支付宝也用假支付

lizhen_gitee 1 year ago
parent
commit
9dff6e3f70
1 changed files with 14 additions and 1 deletions
  1. 14 1
      addons/unishop/controller/Pay.php

+ 14 - 1
addons/unishop/controller/Pay.php

@@ -339,7 +339,20 @@ class Pay extends Base
      * @ApiReturn   (重定向到支付宝支付网页)
      *
      */
-    public function alipay()
+    public function alipay(){
+        Hook::add('paid_success', 'addons\\unishop\\behavior\\Order');
+
+        $orderId = $this->request->request('order_id', 0);
+        $orderId = Hashids::decodeHex($orderId);
+
+        $orderModel = new \addons\unishop\model\Order();
+        $order = $orderModel->where(['id' => $orderId])->find();
+
+        Hook::listen('paid_success', $order, ['pay_type' => \addons\unishop\model\Order::PAY_ALIPAY]);
+
+        $this->success('支付成功', []);
+    }
+    public function alipay_old()
     {
         $this->error('暂不支持支付宝');
         $orderId = $this->request->request('order_id', 0);