Procházet zdrojové kódy

更新优惠券金额计算

lang před 3 roky
rodič
revize
71d22bb8e2
2 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 5 0
      Controller/CloudStorage.py
  2. 1 0
      Controller/PaymentCycle.py

+ 5 - 0
Controller/CloudStorage.py

@@ -1115,6 +1115,7 @@ class CloudStorageView(View):
             return HttpResponse(pay.xml_to_dict({'return_code': 'FAIL', 'return_msg': repr(e)}))
 
     def do_create_pay_order(self, request_dict, userID, ip, response):  # 创建支付订单
+        logger = logging.getLogger('log')
         uid = request_dict.get('uid', None)
         channel = request_dict.get('channel', None)
         pay_type = int(request_dict.get('pay_type', None))
@@ -1188,11 +1189,15 @@ class CloudStorageView(View):
             if price < 0:
                 return response.json(10049)
             price = float(price)
+            logger.info("------------------coupin_price")
+            logger.info(price)
+            price = round(price,2)
 
         if pay_type == 1:
             # 订阅周期扣款
             if(smqs[0]['cycle_config_id']):
                 #查询是否有订阅过,活跃状态
+                # return HttpResponse(price)
                 checkHasSubscribe = Paypal.checkSubscriptions(userID,uid,rank)
                 if checkHasSubscribe is False:
                     return response.json(10050)

+ 1 - 0
Controller/PaymentCycle.py

@@ -42,6 +42,7 @@ class Paypal:
             format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL, lang=lang)
         # call_sub_url = "http://binbin.uicp.vip/cloudstorage/dopaypalcallback?orderID={orderID}".format(
         # SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL, orderID=orderID)
+        # exit(price)
         BillingPlan = {
             "description": orderID,
             "merchant_preferences": {