|
@@ -6,7 +6,6 @@ import time
|
|
|
|
|
|
import itunesiap
|
|
import itunesiap
|
|
from django.db.models import Q
|
|
from django.db.models import Q
|
|
-from django.http import HttpResponseRedirect
|
|
|
|
from django.views import View
|
|
from django.views import View
|
|
from Ansjer.config import LOGGER, CONFIG_INFO, CONFIG_TEST, PAY_TYPE_IN_APP_PURCHASE
|
|
from Ansjer.config import LOGGER, CONFIG_INFO, CONFIG_TEST, PAY_TYPE_IN_APP_PURCHASE
|
|
from Controller.CheckUserData import DataValid
|
|
from Controller.CheckUserData import DataValid
|
|
@@ -63,8 +62,8 @@ class InAppPurchaseView(View):
|
|
redis_key = uid + 'in_app_purchase'
|
|
redis_key = uid + 'in_app_purchase'
|
|
is_lock = redis_obj.CONN.setnx(redis_key, 1)
|
|
is_lock = redis_obj.CONN.setnx(redis_key, 1)
|
|
redis_obj.CONN.expire(redis_key, 60)
|
|
redis_obj.CONN.expire(redis_key, 60)
|
|
- if not is_lock:
|
|
|
|
- return response.json(5)
|
|
|
|
|
|
+ # if not is_lock:
|
|
|
|
+ # return response.json(5)
|
|
|
|
|
|
try:
|
|
try:
|
|
device_info_qs = Device_Info.objects.filter(userID_id=user_id, UID=uid, isShare=False, isExist=1).values(
|
|
device_info_qs = Device_Info.objects.filter(userID_id=user_id, UID=uid, isShare=False, isExist=1).values(
|
|
@@ -171,12 +170,12 @@ class InAppPurchaseView(View):
|
|
cls.do_vod_msg_notice(uid, user_id, lang, sys_msg_text_list)
|
|
cls.do_vod_msg_notice(uid, user_id, lang, sys_msg_text_list)
|
|
|
|
|
|
redis_obj.del_data(redis_key)
|
|
redis_obj.del_data(redis_key)
|
|
- pay_success_url = CommonService.get_payment_status_url(lang, 'success')
|
|
|
|
- return HttpResponseRedirect(pay_success_url)
|
|
|
|
|
|
+ pay_result_url = CommonService.get_payment_status_url(lang, 'success')
|
|
|
|
+ return response.json(0, {'url': pay_result_url})
|
|
except Exception as e:
|
|
except Exception as e:
|
|
redis_obj.del_data(redis_key)
|
|
redis_obj.del_data(redis_key)
|
|
- pay_failed_url = CommonService.get_payment_status_url(lang, 'fail')
|
|
|
|
- return HttpResponseRedirect(pay_failed_url)
|
|
|
|
|
|
+ pay_result_url = CommonService.get_payment_status_url(lang, 'fail')
|
|
|
|
+ return response.json(0, {'url': pay_result_url})
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
def do_vod_msg_notice(cls, uid, user_id, lang, sys_msg_text_list):
|
|
def do_vod_msg_notice(cls, uid, user_id, lang, sys_msg_text_list):
|