mopybird 1 年之前
父節點
當前提交
5f3cd6c37e
共有 2 個文件被更改,包括 20 次插入3 次删除
  1. 17 0
      apps/web/core/models.py
  2. 3 3
      apps/web/core/payment/ali.py

+ 17 - 0
apps/web/core/models.py

@@ -1621,6 +1621,23 @@ class AliFundAccountBookApp(PayAppBase):
     def pay_app_type(self):
         return PayAppType.ALIPAY_FUND_BOOK
 
+    @classmethod
+    def __from_gateway_key__(cls, occupant_id, tokens):
+        # type: (str, List)->cast(PayAppBase, None)
+        appid = tokens[0]
+        app = cls.objects(appid = appid).first()  # type: AliApp
+        if not app:
+            raise UserServerException(u'系统配置错误,请联系平台客服(10005)')
+
+        app.occupantId = occupant_id
+
+        try:
+            app.role = tokens[1]
+        except:
+            app.role = ROLE.agent
+
+        return app
+
     @property
     def __gateway_key__(self):
         _ = [

+ 3 - 3
apps/web/core/payment/ali.py

@@ -274,13 +274,13 @@ class AliPayWithdrawGateway(WithdrawGateway, AlipayMixin):
         else:
             raise AliPayGatewayException(errCode = result['sub_code'], errMsg = result['sub_msg'], client = self)
 
-    def get_transfer_result_via_bank(self, order_no):
+    def get_transfer_result_via_bank(self, order_no, product_code = 'TRANS_BANKCARD_NO_PWD'):
 
         """
         查询银行卡提现的返回结果
         :return:
         """
-        result = self.client.api_alipay_fund_trans_common_query(out_biz_no = order_no)
+        result = self.client.api_alipay_fund_trans_common_query(out_biz_no = order_no, product_code = product_code)
         if result['code'] == u'10000':
             return AlipayWithdrawQueryResult(result)
         elif result['code'] == u'40004':
@@ -329,7 +329,7 @@ class AliPayWithdrawGateway(WithdrawGateway, AlipayMixin):
         查询现金提现的返回结果
         :return:
         """
-        return self.get_transfer_result_via_bank(order_no = order_no)
+        return self.get_transfer_result_via_bank(order_no = order_no, product_code = 'TRANS_ACCOUNT_NO_PWD')
 
 
 class AliPayISVGateway(WithdrawGateway, AlipayMixin):