|
@@ -886,14 +886,13 @@ class CloudStorageView(View):
|
|
|
dvq.update(**dvq_set_update_dict)
|
|
|
|
|
|
order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
|
|
|
- red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
-
|
|
|
+ red_url = "{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
return response.json(0, signature)
|
|
|
except Exception as e:
|
|
|
if order_qs:
|
|
|
order_qs.update(status=10)
|
|
|
- red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
|
|
|
def do_pay_by_paypal_callback(self, request_dict, response):
|
|
@@ -905,7 +904,7 @@ class CloudStorageView(View):
|
|
|
order_qs = Order_Model.objects.filter(orderID=orderID, status=0)
|
|
|
|
|
|
if not orderID:
|
|
|
- red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
else:
|
|
|
order_qs.update(status=10)
|
|
@@ -915,7 +914,7 @@ class CloudStorageView(View):
|
|
|
payres = payment.execute({"payer_id": PayerID})
|
|
|
print(payres)
|
|
|
if not payres:
|
|
|
- red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
print("Payment execute successfully")
|
|
|
|
|
@@ -962,13 +961,13 @@ class CloudStorageView(View):
|
|
|
order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
|
|
|
|
|
|
# return response.json(0)
|
|
|
- red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ red_url = "{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
except Exception as e:
|
|
|
if order_qs:
|
|
|
order_qs.update(status=10)
|
|
|
|
|
|
- red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
|
|
|
def do_pay_by_wechat_callback(self, request, response):
|
|
@@ -1099,7 +1098,7 @@ class CloudStorageView(View):
|
|
|
format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
# call_sub_url = "http://192.168.136.40:8077/cloudstorage/payExecute?orderID={orderID}".format(
|
|
|
# SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
- call_clc_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ call_clc_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
paypalrestsdk.configure(PAYPAL_CRD)
|
|
|
payment = paypalrestsdk.Payment({
|
|
|
"intent": "sale",
|
|
@@ -1133,16 +1132,26 @@ class CloudStorageView(View):
|
|
|
aliPayObj = AliPayObject()
|
|
|
alipay = aliPayObj.conf()
|
|
|
subject = smqs[0]['title'] + smqs[0]['content']
|
|
|
+ # biz_content = {
|
|
|
+ # "subject": subject,
|
|
|
+ # "out_trade_no": orderID,
|
|
|
+ # "total_amount": price,
|
|
|
+ # "product_code": "QUICK_WAP_PAY",
|
|
|
+ # "quit_url": "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
+ # # "qr_pay_mode":4
|
|
|
+ # }
|
|
|
order_string = alipay.api_alipay_trade_wap_pay(
|
|
|
out_trade_no=orderID,
|
|
|
total_amount=price,
|
|
|
subject=subject,
|
|
|
- return_url="{SERVER_DOMAIN_SSL}cloudstorage/payOK".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL),
|
|
|
+ return_url="{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN),
|
|
|
notify_url="{SERVER_DOMAIN_SSL}cloudstorage/doalicallback".format(
|
|
|
- SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
|
|
|
+ SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL),
|
|
|
+ quit_url="{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN),
|
|
|
# return_url="http://192.168.136.40/cloudstorage/payOK",
|
|
|
# notify_url="http://192.168.136.40/cloudstorage/aliPayCallback"
|
|
|
)
|
|
|
+
|
|
|
except Exception as e:
|
|
|
print(repr(e))
|
|
|
return response.json(10, repr(e))
|
|
@@ -1169,10 +1178,7 @@ class CloudStorageView(View):
|
|
|
SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
|
|
|
# 获取参数
|
|
|
response = ResponseObject()
|
|
|
- asy = threading.Thread(target=ModelService.add_log,
|
|
|
- args=(orderID,
|
|
|
- orderID, '进来了,微信支付创建订单' + notify_url))
|
|
|
- asy.start()
|
|
|
+
|
|
|
price = float(price) * 100
|
|
|
parameter_dict = pay.get_parameter(orderID, content, price, ip, notify_url)
|
|
|
print('parameter_dict', parameter_dict)
|