|
@@ -209,27 +209,30 @@ class CloudVodView(View):
|
|
def do_pay_error(self):
|
|
def do_pay_error(self):
|
|
response = HttpResponse()
|
|
response = HttpResponse()
|
|
response.content = '''
|
|
response.content = '''
|
|
- <!DOCTYPE html>
|
|
|
|
- <html lang="en">
|
|
|
|
- <head>
|
|
|
|
- <meta charset="UTF-8">
|
|
|
|
- <meta name="viewport"
|
|
|
|
- content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
|
|
- <title>msg</title>
|
|
|
|
- </head>
|
|
|
|
- <body>
|
|
|
|
- <div class="content"
|
|
|
|
- style="text-align:center;overflow: hidden;padding:20% 10% 10% 10%;margin:0 10%;background-color: #fff;box-shadow:0 4px 20px rgba(0,0,0,0.1);word-break: break-all;min-height: 300px">
|
|
|
|
- <span style="padding: 10px 20px; background-color: #EB6F5A;border-radius:4px;color:#fff;"
|
|
|
|
- onclick="payOKButton()">付款失败</span>
|
|
|
|
- </div>
|
|
|
|
- </body>
|
|
|
|
- <script type="text/javascript">
|
|
|
|
- function payOKButton() {
|
|
|
|
- window.location = 'app://payError?account=13011112222&password=123456'
|
|
|
|
- }
|
|
|
|
- </script>
|
|
|
|
- </html>
|
|
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="en">
|
|
|
|
+<head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <meta name="viewport"
|
|
|
|
+ content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
|
|
|
+ <title>msg</title>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+<div class="content"
|
|
|
|
+ style="text-align:center;overflow: hidden;padding:20% 10% 10% 10%;margin:0 10%;background-color: #fff;box-shadow:0 4px 20px rgba(0,0,0,0.1);word-break: break-all;min-height: 300px">
|
|
|
|
+ <span style="padding: 10px 20px; background-color: #EB6F5A;border-radius:4px;color:#fff;"
|
|
|
|
+ onclick="payOKButton()">付款失败</span>
|
|
|
|
+</div>
|
|
|
|
+</body>
|
|
|
|
+<script type="text/javascript">
|
|
|
|
+ // 点击付款成功按钮
|
|
|
|
+ function payOKButton() {
|
|
|
|
+ // 复杂数据
|
|
|
|
+ // JS通知WKWebView
|
|
|
|
+ window.webkit.messageHandlers.jsCallOC.postMessage({"status": 0});
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+</html>
|
|
'''
|
|
'''
|
|
return response
|
|
return response
|
|
|
|
|
|
@@ -252,8 +255,11 @@ class CloudVodView(View):
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</body>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
|
+ // 点击付款成功按钮
|
|
function payOKButton() {
|
|
function payOKButton() {
|
|
- window.location = 'app://payOK?account=13011112222&password=123456'
|
|
|
|
|
|
+ // 复杂数据
|
|
|
|
+ // JS通知WKWebView
|
|
|
|
+ window.webkit.messageHandlers.jsCallOC.postMessage({"status": 1});
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
</html>
|
|
</html>
|
|
@@ -288,7 +294,9 @@ class CloudVodView(View):
|
|
format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
# call_sub_url = "http://192.168.136.40:8077/cloudVod/payExecute?orderID={orderID}".format(
|
|
# call_sub_url = "http://192.168.136.40:8077/cloudVod/payExecute?orderID={orderID}".format(
|
|
# SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
# SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
- call_clc_url = "http://192.168.136.40:8077/cloudVod/cancleorder"
|
|
|
|
|
|
+
|
|
|
|
+ call_clc_url = "{SERVER_DOMAIN}cloudVod/cancleorder?orderID={orderID}". \
|
|
|
|
+ format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
paypalrestsdk.configure({
|
|
paypalrestsdk.configure({
|
|
"mode": "sandbox", # sandbox or live
|
|
"mode": "sandbox", # sandbox or live
|
|
"client_id": "AfnfDqezODOoWGS-W2Itu-Zl1ay1R95IsGlMqPghPA3KGhkPndNMnQT0bdEewvSv92XAFIfLiinmyhBL",
|
|
"client_id": "AfnfDqezODOoWGS-W2Itu-Zl1ay1R95IsGlMqPghPA3KGhkPndNMnQT0bdEewvSv92XAFIfLiinmyhBL",
|