Parcourir la source

支付宝也用假支付

lizhen_gitee il y a 2 ans
Parent
commit
9dff6e3f70
1 fichiers modifiés avec 14 ajouts et 1 suppressions
  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);