|
@@ -85,7 +85,7 @@ class CloudStorageView(View):
|
|
|
elif operation == 'doalicallback':
|
|
|
return self.do_pay_by_ali_callback(request)
|
|
|
elif operation == 'dowechatnotify':
|
|
|
- return self.do_pay_by_wechat_callback(request, request_dict, response)
|
|
|
+ return self.do_pay_by_wechat_callback(request, response)
|
|
|
elif operation == 'getsignsts':
|
|
|
ip = CommonService.get_ip_address(request)
|
|
|
return self.do_get_sign_sts(request_dict, ip, response)
|
|
@@ -954,22 +954,22 @@ class CloudStorageView(View):
|
|
|
red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
|
|
|
- def do_pay_by_wechat_callback(self, request, request_dict, response):
|
|
|
- result_code = request_dict.get('result_code', None)
|
|
|
- result_codetwo = request.POST.dict()
|
|
|
+ def do_pay_by_wechat_callback(self, request, response):
|
|
|
+
|
|
|
logger = logging.getLogger('log')
|
|
|
|
|
|
- data = json.loads(request.body)
|
|
|
- logger.info(data)
|
|
|
+ logger.info(request.body)
|
|
|
|
|
|
- result_code = data.get('return_code')
|
|
|
+ request_dict = WechatPayObject.weixinpay_call_back(request.body)
|
|
|
+ trade_status = request_dict['result_code'] # 业务结果 SUCCESS/FAIL
|
|
|
try:
|
|
|
- if result_code == 'SUCCESS':
|
|
|
+ if trade_status == "SUCCESS":
|
|
|
logger.info('微信回调返回值 进来了。')
|
|
|
- check_sign = WechatPayObject.get_notifypay(request_dict)
|
|
|
+ check_sign = WechatPayObject.get_notifypay(trade_status)
|
|
|
if not check_sign:
|
|
|
return HttpResponse(WechatPayObject.xml_to_dict({'return_code': 'FAIL', 'return_msg': '签名失败'}))
|
|
|
- orderID = request_dict.get('out_trade_no', None)
|
|
|
+ logger.info('签名成功')
|
|
|
+ orderID = request_dict['out_trade_no'] # 商户订单号
|
|
|
print("进来了,微信支付成功回调")
|
|
|
self.callback_dostatus(orderID)
|
|
|
|