|
@@ -30,7 +30,7 @@ class Test(View):
|
|
alipay_public_key_string = open(BASE_DIR + '/Controller/alipay_public_2048.pem').read()
|
|
alipay_public_key_string = open(BASE_DIR + '/Controller/alipay_public_2048.pem').read()
|
|
orderID = int(time.time())+int(time.time())
|
|
orderID = int(time.time())+int(time.time())
|
|
alipay = AliPay(
|
|
alipay = AliPay(
|
|
- appid="2017080107983629",
|
|
|
|
|
|
+ appid="2016092200569234",
|
|
app_notify_url=None, # the default notify path
|
|
app_notify_url=None, # the default notify path
|
|
app_private_key_string=app_private_key_string,
|
|
app_private_key_string=app_private_key_string,
|
|
# alipay public key, do not use your own public key!
|
|
# alipay public key, do not use your own public key!
|
|
@@ -41,7 +41,7 @@ class Test(View):
|
|
order_string = alipay.api_alipay_trade_wap_pay(
|
|
order_string = alipay.api_alipay_trade_wap_pay(
|
|
out_trade_no=str(orderID),
|
|
out_trade_no=str(orderID),
|
|
total_amount=0.01,
|
|
total_amount=0.01,
|
|
- subject="实用性充气版玩具",
|
|
|
|
|
|
+ subject="实用性充气式玩具",
|
|
return_url="https://test.dvema.com",
|
|
return_url="https://test.dvema.com",
|
|
# notify_url="https://example.com/notify" # this is optional
|
|
# notify_url="https://example.com/notify" # this is optional
|
|
)
|
|
)
|
|
@@ -49,6 +49,7 @@ class Test(View):
|
|
from django.http import HttpResponseRedirect
|
|
from django.http import HttpResponseRedirect
|
|
# return response.json(0,"https://openapi.alipay.com/gateway.do? + {order_string}".format(order_string=order_string))
|
|
# return response.json(0,"https://openapi.alipay.com/gateway.do? + {order_string}".format(order_string=order_string))
|
|
print(order_string)
|
|
print(order_string)
|
|
|
|
+ return HttpResponseRedirect("https://openapi.alipaydev.com/gateway.do?"+order_string)
|
|
return HttpResponseRedirect("https://openapi.alipay.com/gateway.do?"+order_string)
|
|
return HttpResponseRedirect("https://openapi.alipay.com/gateway.do?"+order_string)
|
|
# # 增加
|
|
# # 增加
|
|
# def get(self, request, *args, **kwargs):
|
|
# def get(self, request, *args, **kwargs):
|