Browse Source

假微信支付,直接已支付

lizhen_gitee 1 year ago
parent
commit
8a6cb08f94
1 changed files with 12 additions and 1 deletions
  1. 12 1
      addons/unishop/controller/Pay.php

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

@@ -95,7 +95,18 @@ class Pay extends Base
      * @ApiReturnParams  (name="prepay_id", type="string", description="统一支付接口返回的prepay_id参数值,提交格式如:package: 'prepay_id=' + data.prepay_id")
      *
      */
-    public function unify()
+    public function unify(){
+        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_WXPAY]);
+    }
+    public function unify_old()
     {
 
         $orderId = $this->request->request('order_id', 0);