Change pay relative from wechatpy to pywe-pay

Brightcells 7 anos atrás
pai
commit
06b6949c6c
2 arquivos alterados com 4 adições e 2 exclusões
  1. 3 2
      pay/views.py
  2. 1 0
      requirements.txt

+ 3 - 2
pay/views.py

@@ -6,9 +6,10 @@ from django.db import transaction
6 6
 from django.shortcuts import HttpResponse
7 7
 from logit import logit
8 8
 from paginator import pagination
9
+from pywe_exception import WeChatPayException
10
+from pywe_pay import WeChatPay
9 11
 from pywe_response import WXPAY_NOTIFY_FAIL, WXPAY_NOTIFY_SUCCESS
10 12
 from TimeConvert import TimeConvert as tc
11
-from wechatpy import WeChatPay, WeChatPayException
12 13
 
13 14
 from account.models import UserIncomeExpensesInfo, UserInfo
14 15
 from group.models import GroupPhotoInfo, GroupPhotoOrderInfo
@@ -91,7 +92,7 @@ def wx_order_create_api(request):
91 92
             out_trade_no=order.order_id,
92 93
             total_fee=total_fee,
93 94
             trade_type=trade_type if trade_type != 'MINIAPP' else 'JSAPI',
94
-            user_id=get_user_openid(user, trade_type),  # 可选,用户在商户appid下的唯一标识。trade_type=JSAPI,此参数必传
95
+            openid=get_user_openid(user, trade_type),  # 可选,用户在商户appid下的唯一标识。trade_type=JSAPI,此参数必传
95 96
         )
96 97
     except WeChatPayException:
97 98
         return response(OrderStatusCode.WX_UNIFIED_ORDER_FAIL)

+ 1 - 0
requirements.txt

@@ -28,6 +28,7 @@ pep8==1.7.0
28 28
 pysnippets==1.0.4
29 29
 pywe-miniapp==1.0.0
30 30
 pywe-oauth==1.0.3
31
+pywe-pay==1.0.5
31 32
 pywe-response==1.0.1
32 33
 qiniu==7.1.4
33 34
 redis-extensions==1.0.50