Procházet zdrojové kódy

微信支付 订单4

chenshibin před 4 roky
rodič
revize
d9fa9256f9
2 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 2 1
      Controller/CloudStorage.py
  2. 2 1
      Object/WechatPayObject.py

+ 2 - 1
Controller/CloudStorage.py

@@ -1182,9 +1182,10 @@ class CloudStorageView(View):
             print('parameter_dict', parameter_dict)
             # parameter_dict 参数中获取MWEB_URL 调转页面在路径后面添加redirect_url
             # 统一调用接口
-            response = pay.re_finall()
+            response = pay.re_finall(orderid=orderID)
             if not response:
                 return response.json(10, '生成订单错误.')
+
             # 回调函数
             Order_Model.objects.create(orderID=orderID, UID=uid, channel=channel, userID_id=userID,
                                        desc=content, payType=pay_type, payTime=nowTime,

+ 2 - 1
Object/WechatPayObject.py

@@ -104,7 +104,7 @@ class WechatPayObject:
         else:
             return 'failure'
 
-    def re_finall(self):
+    def re_finall(self,orderid = None):
         """得到prepay_id后再次签名,返回给终端参数.
         """
         self.get_prepay_id()
@@ -121,6 +121,7 @@ class WechatPayObject:
         self.get_sign(sign_again_params)
         sign_again_params['sign'] = sign_again_params['sign']
         sign_again_params['packageId'] = sign_again_params['package']
+        sign_again_params['out_trade_no'] = orderid
         return sign_again_params  # 返回给app
 
     def get_notifypay(self, data):