|
@@ -960,14 +960,11 @@ class CloudStorageView(View):
|
|
trade_status = data['result_code'] # 业务结果 SUCCESS/FAIL
|
|
trade_status = data['result_code'] # 业务结果 SUCCESS/FAIL
|
|
out_trade_no = data['out_trade_no'] # 商户订单号
|
|
out_trade_no = data['out_trade_no'] # 商户订单号
|
|
order_qs = Order_Model.objects.filter(orderID=out_trade_no, status=0)
|
|
order_qs = Order_Model.objects.filter(orderID=out_trade_no, status=0)
|
|
- logger.info(data)
|
|
|
|
if trade_status == "SUCCESS":
|
|
if trade_status == "SUCCESS":
|
|
check_sign = pay.get_notifypay(data)
|
|
check_sign = pay.get_notifypay(data)
|
|
if not check_sign:
|
|
if not check_sign:
|
|
return HttpResponse(pay.xml_to_dict({'return_code': 'FAIL', 'return_msg': '签名失败'}))
|
|
return HttpResponse(pay.xml_to_dict({'return_code': 'FAIL', 'return_msg': '签名失败'}))
|
|
- logger.info('签名成功')
|
|
|
|
orderID = out_trade_no
|
|
orderID = out_trade_no
|
|
-
|
|
|
|
#redis加锁,防止订单重复
|
|
#redis加锁,防止订单重复
|
|
redisObj = RedisObject()
|
|
redisObj = RedisObject()
|
|
isLock = redisObj.CONN.setnx(orderID + 'do_notify', 1)
|
|
isLock = redisObj.CONN.setnx(orderID + 'do_notify', 1)
|
|
@@ -979,7 +976,14 @@ class CloudStorageView(View):
|
|
order_list = order_qs.values("UID", "channel", "commodity_code", "rank", "isSelectDiscounts",
|
|
order_list = order_qs.values("UID", "channel", "commodity_code", "rank", "isSelectDiscounts",
|
|
"userID__userID", "userID__username","status")
|
|
"userID__userID", "userID__username","status")
|
|
|
|
|
|
|
|
+ if order_list[0]['status'] == 1:
|
|
|
|
+ return HttpResponse("<xml>\
|
|
|
|
+ <return_code><![CDATA[SUCCESS]]></return_code>\
|
|
|
|
+ <return_msg><![CDATA[OK]]></return_msg>\
|
|
|
|
+ </xml>")
|
|
|
|
+
|
|
logger.info(order_list[0]['UID'])
|
|
logger.info(order_list[0]['UID'])
|
|
|
|
+ logger.info(orderID)
|
|
|
|
|
|
userid = order_list[0]['userID__userID']
|
|
userid = order_list[0]['userID__userID']
|
|
username = order_list[0]['userID__username']
|
|
username = order_list[0]['userID__username']
|
|
@@ -1053,9 +1057,11 @@ class CloudStorageView(View):
|
|
'Dear customer,you already subscribed the cloud storage package successfully for device ' + UID + ' on ' + time.strftime(
|
|
'Dear customer,you already subscribed the cloud storage package successfully for device ' + UID + ' on ' + time.strftime(
|
|
"%b %dth,%Y", time.localtime())]
|
|
"%b %dth,%Y", time.localtime())]
|
|
self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
|
|
self.do_vod_msg_Notice(UID, channel, userid, lang, sys_msg_text_list, 'SMS_219738485')
|
|
- logger.info(pay.xml_to_dict({'return_code': 'SUCCESS', 'return_msg': 'OK'}))
|
|
|
|
redisObj.del_data(key=orderID + 'do_notify')
|
|
redisObj.del_data(key=orderID + 'do_notify')
|
|
- return HttpResponse(pay.xml_to_dict({'return_code': 'SUCCESS', 'return_msg': 'OK'}))
|
|
|
|
|
|
+ return HttpResponse("<xml>\
|
|
|
|
+ <return_code><![CDATA[SUCCESS]]></return_code>\
|
|
|
|
+ <return_msg><![CDATA[OK]]></return_msg>\
|
|
|
|
+ </xml>")
|
|
else:
|
|
else:
|
|
order_qs.update(status=10, promotion_rule_id=promotion_rule_id)
|
|
order_qs.update(status=10, promotion_rule_id=promotion_rule_id)
|
|
return HttpResponse(pay.xml_to_dict({'return_code': 'FAIL', 'return_msg': '参数格式校验错误'}))
|
|
return HttpResponse(pay.xml_to_dict({'return_code': 'FAIL', 'return_msg': '参数格式校验错误'}))
|