Kaynağa Gözat

返回支付成功或失败url

locky 1 yıl önce
ebeveyn
işleme
51c0445fe1
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      Controller/InAppPurchaseController.py

+ 5 - 2
Controller/InAppPurchaseController.py

@@ -6,6 +6,7 @@ import time
 
 import itunesiap
 from django.db.models import Q
+from django.http import HttpResponseRedirect
 from django.views import View
 from Ansjer.config import LOGGER, CONFIG_INFO, CONFIG_TEST, PAY_TYPE_IN_APP_PURCHASE
 from Controller.CheckUserData import DataValid
@@ -170,10 +171,12 @@ class InAppPurchaseView(View):
             cls.do_vod_msg_notice(uid, user_id, lang, sys_msg_text_list)
 
             redis_obj.del_data(redis_key)
-            return response.json(0)
+            pay_success_url = CommonService.get_payment_status_url(lang, 'success')
+            return HttpResponseRedirect(pay_success_url)
         except Exception as e:
             redis_obj.del_data(redis_key)
-            return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
+            pay_failed_url = CommonService.get_payment_status_url(lang, 'fail')
+            return HttpResponseRedirect(pay_failed_url)
 
     @classmethod
     def do_vod_msg_notice(cls, uid, user_id, lang, sys_msg_text_list):