Skip to content

Commit b8867c1

Browse files
committed
feat: 添加支付功能并优化歌曲提交流程
- 新增支付功能,支持支付宝和微信支付 - 优化歌曲提交流程,增加支付确认步骤 - 新增支付模态框组件 - 修改App.jsx以支持新的支付流程
1 parent 57ef841 commit b8867c1

File tree

127 files changed

+29948
-1369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+29948
-1369
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
.DS_Store
33
*.sqlite
44
.DS_Store
5-

SDK/epayapi.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>正在为您跳转到支付页面,请稍候...</title>
7+
<style type="text/css">
8+
body{margin:0;padding:0}
9+
p{position:absolute;left:50%;top:50%;height:35px;margin:-35px 0 0 -160px;padding:20px;font:bold 16px/30px "宋体",Arial;text-indent:40px;border:1px solid #c5d0dc}
10+
#waiting{font-family:Arial}
11+
</style>
12+
</head>
13+
<body>
14+
<?php
15+
16+
require_once("lib/epay.config.php");
17+
require_once("lib/EpayCore.class.php");
18+
19+
/**************************请求参数**************************/
20+
$notify_url = "http://127.0.0.1/SDK/notify_url.php";
21+
//需http://格式的完整路径,不能加?id=123这类自定义参数
22+
23+
//页面跳转同步通知页面路径
24+
$return_url = "http://127.0.0.1/SDK/return_url.php";
25+
//需http://格式的完整路径,不能加?id=123这类自定义参数
26+
27+
//商户订单号
28+
$out_trade_no = $_POST['WIDout_trade_no'];
29+
//商户网站订单系统中唯一订单号,必填
30+
31+
//支付方式(可传入alipay,wxpay,qqpay,bank,jdpay)
32+
$type = $_POST['type'];
33+
//商品名称
34+
$name = $_POST['WIDsubject'];
35+
//付款金额
36+
$money = $_POST['WIDtotal_fee'];
37+
38+
39+
/************************************************************/
40+
41+
//构造要请求的参数数组,无需改动
42+
$parameter = array(
43+
"pid" => $epay_config['pid'],
44+
"type" => $type,
45+
"notify_url" => $notify_url,
46+
"return_url" => $return_url,
47+
"out_trade_no" => $out_trade_no,
48+
"name" => $name,
49+
"money" => $money,
50+
);
51+
52+
//建立请求
53+
$epay = new EpayCore($epay_config);
54+
$html_text = $epay->pagePay($parameter);
55+
echo $html_text;
56+
57+
?>
58+
<p>正在为您跳转到支付页面,请稍候...</p>
59+
</body>
60+
</html>

SDK/index.php

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<?php
2+
/* *
3+
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
4+
*/
5+
6+
?>
7+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8+
<html>
9+
<head>
10+
<title>彩虹易支付接口测试</title>
11+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12+
<style>
13+
*{
14+
margin:0;
15+
padding:0;
16+
}
17+
ul,ol{
18+
list-style:none;
19+
}
20+
.title{
21+
color: #ADADAD;
22+
font-size: 14px;
23+
font-weight: bold;
24+
padding: 8px 16px 5px 10px;
25+
}
26+
.hidden{
27+
display:none;
28+
}
29+
30+
.new-btn-login-sp{
31+
border:1px solid #D74C00;
32+
padding:1px;
33+
display:inline-block;
34+
}
35+
36+
.new-btn-login{
37+
background-color: #ff8c00;
38+
color: #FFFFFF;
39+
font-weight: bold;
40+
border: medium none;
41+
width:82px;
42+
height:28px;
43+
}
44+
.new-btn-login:hover{
45+
background-color: #ffa300;
46+
width: 82px;
47+
color: #FFFFFF;
48+
font-weight: bold;
49+
height: 28px;
50+
}
51+
.bank-list{
52+
overflow:hidden;
53+
margin-top:5px;
54+
}
55+
.bank-list li{
56+
float:left;
57+
width:153px;
58+
margin-bottom:5px;
59+
}
60+
61+
#main{
62+
width:750px;
63+
margin:0 auto;
64+
font-size:14px;
65+
font-family:'宋体';
66+
}
67+
#logo{
68+
background-color: transparent;
69+
background-image: url("images/new-btn-fixed.png");
70+
border: medium none;
71+
background-position:0 0;
72+
width:166px;
73+
height:35px;
74+
float:left;
75+
}
76+
.red-star{
77+
color:#f00;
78+
width:10px;
79+
display:inline-block;
80+
}
81+
.null-star{
82+
color:#fff;
83+
}
84+
.content{
85+
margin-top:5px;
86+
}
87+
88+
.content dt{
89+
width:160px;
90+
display:inline-block;
91+
text-align:right;
92+
float:left;
93+
94+
}
95+
.content dd{
96+
margin-left:100px;
97+
margin-bottom:5px;
98+
}
99+
#foot{
100+
margin-top:10px;
101+
}
102+
.foot-ul li {
103+
text-align:center;
104+
}
105+
.note-help {
106+
color: #999999;
107+
font-size: 12px;
108+
line-height: 130%;
109+
padding-left: 3px;
110+
}
111+
112+
.cashier-nav {
113+
font-size: 14px;
114+
margin: 15px 0 10px;
115+
text-align: left;
116+
height:30px;
117+
border-bottom:solid 2px #CFD2D7;
118+
}
119+
.cashier-nav ol li {
120+
float: left;
121+
}
122+
.cashier-nav li.current {
123+
color: #AB4400;
124+
font-weight: bold;
125+
}
126+
.cashier-nav li.last {
127+
clear:right;
128+
}
129+
.alipay_link {
130+
text-align:right;
131+
}
132+
.alipay_link a:link{
133+
text-decoration:none;
134+
color:#8D8D8D;
135+
}
136+
.alipay_link a:visited{
137+
text-decoration:none;
138+
color:#8D8D8D;
139+
}
140+
</style>
141+
</head>
142+
<body text=#000000 bgColor=#ffffff leftMargin=0 topMargin=4>
143+
<div id="main">
144+
<div id="head">
145+
<dl class="alipay_link">
146+
</dl>
147+
<span class="title">彩虹易支付接口测试</span>
148+
</div>
149+
<div class="cashier-nav">
150+
<ol>
151+
<li class="current">1、确认信息 →</li>
152+
<li>2、点击确认 →</li>
153+
<li class="last">3、确认完成</li>
154+
</ol>
155+
</div>
156+
<form name=alipayment action=epayapi.php method=post target="_blank">
157+
<div id="body" style="clear:left">
158+
<dl class="content">
159+
<dt>商户订单号:</dt>
160+
<dd>
161+
<span class="null-star">*</span>
162+
<input size="30" name="WIDout_trade_no" value="<?php echo date("YmdHis").mt_rand(100,999); ?>"/>
163+
<span>商户网站订单系统中唯一订单号,必填
164+
</span>
165+
</dd>
166+
<dt>商品名称:</dt>
167+
<dd>
168+
<span class="null-star">*</span>
169+
<input size="30" name="WIDsubject" value="测试商品"/>
170+
<span>必填
171+
</span>
172+
</dd>
173+
<dt>付款金额:</dt>
174+
<dd>
175+
<span class="null-star">*</span>
176+
<input size="30" name="WIDtotal_fee" value="1"/>
177+
<span>必填
178+
</span>
179+
</dd>
180+
<dt>支付方式:</dt>
181+
<dd>
182+
<label><input type="radio" name="type" value="alipay" checked="">支付宝</label>&nbsp; <label><input type="radio" name="type" value="qqpay">QQ钱包</label>&nbsp;<label><input type="radio" name="type" value="wxpay">微信支付</label>&nbsp;<label><input type="radio" name="type" value="bank">云闪付</label>
183+
</dd>
184+
185+
186+
<dt></dt>
187+
<dd>
188+
<span class="new-btn-login-sp">
189+
<button class="new-btn-login" type="submit" style="text-align:center;">确 认</button>
190+
</span>
191+
</dd>
192+
</dl>
193+
</div>
194+
</form>
195+
<div id="foot">
196+
<ul class="foot-ul">
197+
<li><font class="note-help">如果您点击“确认”按钮,即表示您同意该次的执行操作。 </font></li>
198+
<li>
199+
200+
</li>
201+
</ul>
202+
</div>
203+
</div>
204+
</body>
205+
</html>

0 commit comments

Comments
 (0)