PayService.py 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. # -*- coding: utf-8 -*-
  2. # 支付类
  3. class PaymentService:
  4. # 返回支付失败html内容
  5. @staticmethod
  6. def get_pay_error_content():
  7. return '''
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <!--浏览器不缓存-->
  12. <meta http-equiv="Pragma" content="no-cache">
  13. <meta http-equiv="Cache-Control" content="no-cache">
  14. <meta http-equiv="Expires" content="0">
  15. <!--utf-8-->
  16. <meta http-equiv="content-type" content="text/html;charset=utf-8">
  17. <!-- viewport的<meta>标签,这个标签可以修改在大部分的移动设备上面的显示,为了确保适当的绘制和触屏缩放。-->
  18. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  19. <link rel="shortcut icon" href="https://test.zositechc.cn/web/images/favicon.ico" type="image/x-icon" charset="utf-8"/>
  20. <title>Trading particulars</title>
  21. <style>
  22. .title_head{
  23. height: 50px;
  24. border-radius: 5px;
  25. background-color: #c3c6c7;
  26. text-align: center;
  27. line-height: 50px;
  28. }
  29. .content{
  30. text-align: center;
  31. margin-top: 50px;
  32. font-size: 20px;
  33. color : #ec7648
  34. }
  35. .content_img{
  36. width: 60px;
  37. height: 60px;
  38. }
  39. .bottom{
  40. margin-bottom: 10px;
  41. margin-top: 250px;
  42. color : #ec7648
  43. }
  44. .bottom_div{
  45. border: 1px solid #ec7648;
  46. line-height: 38px;
  47. text-align: center;
  48. width: 100px;
  49. height: 38px;
  50. border-radius: 5px;
  51. }
  52. .bottom_div:hover{
  53. background-color: #dde4e2;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <div class="title_head">Trading particulars</div>
  59. <div class="content">
  60. <p >
  61. <img src="https://test.zositechc.cn/web/images/failed.jpg" class="content_img">
  62. <br />
  63. Payment failure
  64. </p>
  65. </div>
  66. <center class="bottom">
  67. <div class="bottom_div" onclick="payOKButton()">
  68. Finish
  69. </div>
  70. </center>
  71. <script> // 点击付款成功按钮
  72. function payOKButton() {
  73. // 复杂数据
  74. console.log('success')
  75. window.location.href="https://www.baidu.com?page=closePage";
  76. }
  77. </script>
  78. </body>
  79. </html>
  80. '''
  81. # 返回支付成功html内容
  82. @staticmethod
  83. def get_pay_ok_content(lang, pay_type):
  84. title = "支付成功"
  85. complete = '完成'
  86. if lang == 'cn':
  87. if pay_type == "10":
  88. title = "体验成功"
  89. if pay_type == "11":
  90. title = "兑换成功"
  91. else:
  92. title = "Payment successful"
  93. complete = 'complete'
  94. if pay_type == "10":
  95. title = "Successful experience"
  96. if pay_type == "11":
  97. title = "Successful exchange"
  98. return '''
  99. <html>
  100. <head>
  101. <!--浏览器不缓存-->
  102. <meta http-equiv="Pragma" content="no-cache">
  103. <meta http-equiv="Cache-Control" content="no-cache">
  104. <meta http-equiv="Expires" content="0">
  105. <!--utf-8-->
  106. <meta http-equiv="content-type" content="text/html;charset=utf-8">
  107. <!-- viewport的<meta>标签,这个标签可以修改在大部分的移动设备上面的显示,为了确保适当的绘制和触屏缩放。-->
  108. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  109. <link rel="shortcut icon" href="https://test.zositechc.cn/web/images/favicon.ico" type="image/x-icon" charset="utf-8">
  110. <title>''' + title + '''</title>
  111. <style>
  112. .title_head{
  113. height: 50px;
  114. border-radius: 5px;
  115. background-color: #c3c6c7;
  116. text-align: center;
  117. line-height: 50px;
  118. }
  119. .content{
  120. text-align: center;
  121. margin-top: 50px;
  122. font-size: 15px;
  123. color:#0000008A;
  124. }
  125. .content_img{
  126. margin-bottom:15px;
  127. width: 60px;
  128. height: 60px;
  129. }
  130. .bottom{
  131. margin-bottom: 10px;
  132. margin-top: 250px;
  133. color : white;
  134. }
  135. .bottom_div{
  136. border: 1px solid #68c9c5;
  137. line-height: 38px;
  138. text-align: center;
  139. width: 100px;
  140. height: 38px;
  141. border-radius: 30px;
  142. background-color:#68c9c5;
  143. }
  144. .bottom_div:hover{
  145. background-color: #dde4e2;
  146. }
  147. </style>
  148. </head>
  149. <body style="" rlt="1" inmaintabuse="true">
  150. <div class="content">
  151. <p>
  152. <img src="https://test.zositechc.cn/web/images/success.png" class="content_img">
  153. <br>
  154. ''' + title + '''
  155. </p>
  156. </div>
  157. <center class="bottom">
  158. <div class="bottom_div" onclick="payOKButton()">
  159. ''' + complete + '''
  160. </div>
  161. </center>
  162. <script src="//hm.baidu.com/hm.js?eaa57ca47dacb4ad4f5a257001a3457c"></script><script> // 点击付款成功按钮
  163. function payOKButton() {
  164. // 复杂数据
  165. console.log('success')
  166. window.location.href="https://www.baidu.com?page=closePage"
  167. }
  168. </script>
  169. <div id="qds" style="display:none;"></div></body></html>
  170. '''