|
@@ -906,8 +906,8 @@ class CloudStorageView(View):
|
|
if not orderID:
|
|
if not orderID:
|
|
red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
return HttpResponseRedirect(red_url)
|
|
return HttpResponseRedirect(red_url)
|
|
- else:
|
|
|
|
- order_qs.update(status=10)
|
|
|
|
|
|
+ # else:
|
|
|
|
+ # order_qs.update(status=9)
|
|
paypalrestsdk.configure(PAYPAL_CRD)
|
|
paypalrestsdk.configure(PAYPAL_CRD)
|
|
# ID of the payment. This ID is provided when creating payment.
|
|
# ID of the payment. This ID is provided when creating payment.
|
|
payment = paypalrestsdk.Payment.find(paymentId)
|
|
payment = paypalrestsdk.Payment.find(paymentId)
|
|
@@ -964,6 +964,7 @@ class CloudStorageView(View):
|
|
red_url = "{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
red_url = "{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
return HttpResponseRedirect(red_url)
|
|
return HttpResponseRedirect(red_url)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
|
+ print(repr(e))
|
|
if order_qs:
|
|
if order_qs:
|
|
order_qs.update(status=10)
|
|
order_qs.update(status=10)
|
|
|
|
|
|
@@ -1094,10 +1095,10 @@ class CloudStorageView(View):
|
|
|
|
|
|
orderID = CommonService.createOrderID()
|
|
orderID = CommonService.createOrderID()
|
|
if pay_type == 1:
|
|
if pay_type == 1:
|
|
- #call_sub_url = "{SERVER_DOMAIN}cloudstorage/dopaypalcallback?orderID={orderID}". \
|
|
|
|
- #format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
|
- call_sub_url = "http://binbin.uicp.vip/cloudstorage/dopaypalcallback?orderID={orderID}".format(
|
|
|
|
- SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
|
|
|
+ call_sub_url = "{SERVER_DOMAIN}cloudstorage/dopaypalcallback?orderID={orderID}". \
|
|
|
|
+ format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
|
+ #call_sub_url = "http://binbin.uicp.vip/cloudstorage/dopaypalcallback?orderID={orderID}".format(
|
|
|
|
+ #SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
call_clc_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
call_clc_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
paypalrestsdk.configure(PAYPAL_CRD)
|
|
paypalrestsdk.configure(PAYPAL_CRD)
|
|
payment = paypalrestsdk.Payment({
|
|
payment = paypalrestsdk.Payment({
|
|
@@ -1105,8 +1106,6 @@ class CloudStorageView(View):
|
|
"payer": {"payment_method": "paypal"},
|
|
"payer": {"payment_method": "paypal"},
|
|
"redirect_urls": {"return_url": call_sub_url, "cancel_url": call_clc_url},
|
|
"redirect_urls": {"return_url": call_sub_url, "cancel_url": call_clc_url},
|
|
"transactions": [{
|
|
"transactions": [{
|
|
- "item_list": {"items": [
|
|
|
|
- {"name": "Cloud video", "sku": "1", "price": price, "currency": "USD", "quantity": 1}]},
|
|
|
|
"amount": {"total": price, "currency": currency},
|
|
"amount": {"total": price, "currency": currency},
|
|
"description": content}]})
|
|
"description": content}]})
|
|
if payment.create():
|
|
if payment.create():
|