magpie 0.8.6.1 → 0.8.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +99 -0
- data/doc/AlipayModel.html +2010 -0
- data/doc/ChinabankModel.html +1245 -0
- data/doc/Magpie.html +255 -0
- data/doc/Magpie/Alipay.html +254 -0
- data/doc/Magpie/Chinabank.html +252 -0
- data/doc/Magpie/Mothlog.html +252 -0
- data/doc/Magpie/Server.html +241 -0
- data/doc/Magpie/Server/Options.html +245 -0
- data/doc/Magpie/Utils.html +85 -0
- data/doc/_index.html +186 -0
- data/doc/class_list.html +36 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +307 -0
- data/doc/file.COPYING.html +78 -0
- data/doc/file.README.html +162 -0
- data/doc/file_list.html +38 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +162 -0
- data/doc/js/app.js +202 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +154 -0
- data/doc/method_list.html +499 -0
- data/doc/top-level-namespace.html +90 -0
- data/lib/doc/_index.html +72 -0
- data/lib/doc/class_list.html +36 -0
- data/lib/doc/css/common.css +1 -0
- data/lib/doc/css/full_list.css +53 -0
- data/lib/doc/css/style.css +307 -0
- data/lib/doc/file_list.html +35 -0
- data/lib/doc/frames.html +13 -0
- data/lib/doc/index.html +72 -0
- data/lib/doc/js/app.js +202 -0
- data/lib/doc/js/full_list.js +149 -0
- data/lib/doc/js/jquery.js +154 -0
- data/lib/doc/method_list.html +35 -0
- data/lib/doc/top-level-namespace.html +78 -0
- data/lib/magpie.rb +1 -1
- data/lib/models/alipay.rb +1 -1
- data/magpie.gemspec +4 -4
- data/test/test_alipay.rb +1 -1
- metadata +44 -7
- data/README +0 -37
@@ -0,0 +1,78 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>File: COPYING</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="_index.html" title="Index">Index</a> »
|
27
|
+
<span class="title">File: COPYING</span>
|
28
|
+
|
29
|
+
|
30
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div id="search">
|
34
|
+
<a id="class_list_link" href="#">Class List</a>
|
35
|
+
<a id="method_list_link" href="#">Method List</a>
|
36
|
+
<a id ="file_list_link" href="#">File List</a>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="clear"></div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<iframe id="search_frame"></iframe>
|
43
|
+
|
44
|
+
<div id="content"><div id='filecontents'><p>
|
45
|
+
Copyright © 2010 jiangguimin <kayak.jaing@gmail.com>
|
46
|
+
</p>
|
47
|
+
<p>
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
49
|
+
copy of this software and associated documentation files (the
|
50
|
+
“Software”), to deal in the Software without restriction,
|
51
|
+
including without limitation the rights to use, copy, modify, merge,
|
52
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
53
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
54
|
+
following conditions:
|
55
|
+
</p>
|
56
|
+
<p>
|
57
|
+
The above copyright notice and this permission notice shall be included in
|
58
|
+
all copies or substantial portions of the Software.
|
59
|
+
</p>
|
60
|
+
<p>
|
61
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
62
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
63
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
64
|
+
NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
65
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
66
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
67
|
+
DEALINGS IN THE SOFTWARE.
|
68
|
+
</p>
|
69
|
+
</div></div>
|
70
|
+
|
71
|
+
<div id="footer">
|
72
|
+
Generated on Thu Oct 21 11:48:12 2010 by
|
73
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
74
|
+
0.6.1 (ruby-1.8.7).
|
75
|
+
</div>
|
76
|
+
|
77
|
+
</body>
|
78
|
+
</html>
|
@@ -0,0 +1,162 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Documentation by YARD 0.6.1</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="_index.html" title="Index">Index</a> »
|
27
|
+
<span class="title">File: README</span>
|
28
|
+
|
29
|
+
|
30
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div id="search">
|
34
|
+
<a id="class_list_link" href="#">Class List</a>
|
35
|
+
<a id="method_list_link" href="#">Method List</a>
|
36
|
+
<a id ="file_list_link" href="#">File List</a>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="clear"></div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<iframe id="search_frame"></iframe>
|
43
|
+
|
44
|
+
<div id="content"><div id='filecontents'><h1>Magpie用于模拟支付平台的沙盒功能</h1>
|
45
|
+
|
46
|
+
<p><strong>Git</strong>: <a href="http://github.com/baya/magpie">http://github.com/baya/magpie</a></p>
|
47
|
+
|
48
|
+
<p><strong>Author</strong>: Guimin Jiang</p>
|
49
|
+
|
50
|
+
<p><strong>Copyright</strong>: 2010</p>
|
51
|
+
|
52
|
+
<p><strong>License</strong>: MIT License</p>
|
53
|
+
|
54
|
+
<p><strong>Latest Version</strong>: 0.8.6.2</p>
|
55
|
+
|
56
|
+
<p><strong>Release Date</strong>: 2010-10-20</p>
|
57
|
+
|
58
|
+
<h2>快搭</h2>
|
59
|
+
|
60
|
+
<pre class="code"><span class='sudo identifier id'>sudo</span> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='magpie identifier id'>magpie</span>
|
61
|
+
</pre>
|
62
|
+
|
63
|
+
<p>打开终端,输入:</p>
|
64
|
+
|
65
|
+
<pre class="code">$ <span class='mag identifier id'>mag</span> <span class='magpie identifier id'>magpie</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
66
|
+
</pre>
|
67
|
+
|
68
|
+
<p>magpie.yml文件用来配置你的商号信息, 假设你在支付宝有个账号:123456, key是:aaabbb, 网银在线有个账号:789789, key是:cccddd, 那么你在magpie.yml中这样写,</p>
|
69
|
+
|
70
|
+
<pre class="code"><span class='alipay identifier id'>alipay</span><span class='colon op'>:</span>
|
71
|
+
<span class='minus op'>-</span> <span class='lbrack token'>[</span><span class='string val'>"123456"</span><span class='comma token'>,</span> <span class='string val'>"aaabbb"</span><span class='rbrack token'>]</span>
|
72
|
+
|
73
|
+
<span class='chinabank identifier id'>chinabank</span><span class='colon op'>:</span>
|
74
|
+
<span class='minus op'>-</span> <span class='lbrack token'>[</span><span class='string val'>"789789"</span><span class='comma token'>,</span> <span class='string val'>"cccddd"</span><span class='rbrack token'>]</span>
|
75
|
+
</pre>
|
76
|
+
|
77
|
+
<p><strong>注意!</strong> 如果你输入mag命令报错, 那可能是因为你的电脑缺少一些magpie需要的gem包, 试着使用下面的命令:</p>
|
78
|
+
|
79
|
+
<pre class="code">$ <span class='sudo identifier id'>sudo</span> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='activemode identifier id'>activemode</span>
|
80
|
+
$ <span class='sudo identifier id'>sudo</span> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='hpricot identifier id'>hpricot</span>
|
81
|
+
</pre>
|
82
|
+
|
83
|
+
<p>mag命令默认会在本地9292端口启动http服务, 你可以用-p选项指定端口</p>
|
84
|
+
|
85
|
+
<pre class="code"><span class='mag identifier id'>mag</span> <span class='minus op'>-</span><span class='p identifier id'>p</span> <span class='integer val'>2010</span> <span class='magpie identifier id'>magpie</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
86
|
+
</pre>
|
87
|
+
|
88
|
+
<p>mag命令的更多选项可以通过<code>mag -h</code>查看</p>
|
89
|
+
|
90
|
+
<h2>使用示例</h2>
|
91
|
+
|
92
|
+
<p>假设你正在实现支付宝支付的相关代码, 首先启动magpie服务</p>
|
93
|
+
|
94
|
+
<pre class="code">$ <span class='mag identifier id'>mag</span> <span class='magpie identifier id'>magpie</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
95
|
+
</pre>
|
96
|
+
|
97
|
+
<p>然后在你开发的商户系统中将支付网关由支付宝的网关<code>https://www.alipay.com/cooperate/gateway.do</code>更改为magpie的网关<code>http://127.0.0.1:9292/alipay</code></p>
|
98
|
+
|
99
|
+
<p>如果你请求的参数出现错误,你可以通过magpie的日志查看到详细的出错信息, 或者在浏览器上查看出错信息(以xml的格式显示)</p>
|
100
|
+
|
101
|
+
<p>如果你的支付请求成功magpie将会模拟支付宝的主动通知模式, 给你商户系统发送通知, 你需要确保发送给magpie的<code>notify_url</code></p>
|
102
|
+
|
103
|
+
<p>是可用的,magpie将通过这个<code>notify_url</code>将支付成功的通知发到你的商户系统中, 这样你就可以避免去支付宝的页面进行真实的支付.</p>
|
104
|
+
|
105
|
+
<p>对于网银在线, 将支付网关由网银在线的网关<code>https://pay3.chinabank.com.cn/PayGate</code>更改为magpie的网关<code>http://127.0.0.1:9292/chinabank</code></p>
|
106
|
+
|
107
|
+
<h2>支持的支付平台</h2>
|
108
|
+
|
109
|
+
<ul>
|
110
|
+
<li>支付宝(alipay)</li>
|
111
|
+
<li>网银在线(chinabank)</li>
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
|
115
|
+
<h2>使用的项目</h2>
|
116
|
+
|
117
|
+
<ul>
|
118
|
+
<li><a href="http://piao.fantong.com">饭票</a></li>
|
119
|
+
<li><a href="http://tuan.fantong.com">饭团</a></li>
|
120
|
+
</ul>
|
121
|
+
|
122
|
+
|
123
|
+
<h2>感谢</h2>
|
124
|
+
|
125
|
+
<ul>
|
126
|
+
<li>potian <a href="http://www.javaeye.com/topic/605707">Rack编程</a>的作者</li>
|
127
|
+
<li>liuzihua</li>
|
128
|
+
</ul>
|
129
|
+
|
130
|
+
|
131
|
+
<h2>Changelog</h2>
|
132
|
+
|
133
|
+
<ul>
|
134
|
+
<li><p><strong>2010-10-20</strong>: 0.8.6.1 release</p>
|
135
|
+
|
136
|
+
<ul>
|
137
|
+
<li>支持网银在线</li>
|
138
|
+
</ul>
|
139
|
+
</li>
|
140
|
+
<li><p><strong>2010-10-20</strong>: 0.8.6.1 release</p>
|
141
|
+
|
142
|
+
<ul>
|
143
|
+
<li>改善README.md的可阅读性</li>
|
144
|
+
</ul>
|
145
|
+
</li>
|
146
|
+
</ul>
|
147
|
+
|
148
|
+
|
149
|
+
<h2>Copyright</h2>
|
150
|
+
|
151
|
+
<p>MAGPIE © 2007-2010 by <a href="mailto:kayak.jiang@gmail.com">Guimin Jiang</a>.
|
152
|
+
MAGPIE is licensed under the MIT license except for some files which come
|
153
|
+
from the RDoc/Ruby distributions. Please see the <a href="file.COPYING.html" title="COPYING">COPYING</a> documents for more information.</p></div></div>
|
154
|
+
|
155
|
+
<div id="footer">
|
156
|
+
Generated on Thu Oct 21 14:14:14 2010 by
|
157
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
158
|
+
0.6.1 (ruby-1.8.7).
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</body>
|
162
|
+
</html>
|
data/doc/file_list.html
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
7
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
9
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
10
|
+
<base id="base_target" target="_parent" />
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<script type="text/javascript" charset="utf-8">
|
14
|
+
if (window.top.frames.main) {
|
15
|
+
document.getElementById('base_target').target = 'main';
|
16
|
+
document.body.className = 'frames';
|
17
|
+
}
|
18
|
+
</script>
|
19
|
+
<div id="content">
|
20
|
+
<h1 id="full_list_header">File List</h1>
|
21
|
+
<div id="nav">
|
22
|
+
<a target="_self" href="class_list.html">Classes</a> |
|
23
|
+
<a target="_self" href="method_list.html">Methods</a> |
|
24
|
+
<a target="_self" href="file_list.html">Files</a>
|
25
|
+
</div>
|
26
|
+
<div id="search">Search: <input type="text" /></div>
|
27
|
+
|
28
|
+
<ul id="full_list" class="files">
|
29
|
+
|
30
|
+
|
31
|
+
<li class="r1"><a href="index.html" title="README">README</a></li>
|
32
|
+
|
33
|
+
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
</body>
|
37
|
+
</html>
|
38
|
+
|
data/doc/frames.html
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
|
+
<title>Documentation by YARD 0.6.1</title>
|
8
|
+
</head>
|
9
|
+
<frameset cols="20%,*">
|
10
|
+
<frame name="list" src="class_list.html" />
|
11
|
+
<frame name="main" src="index.html" />
|
12
|
+
</frameset>
|
13
|
+
</html>
|
data/doc/index.html
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Documentation by YARD 0.6.1</title>
|
7
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
|
10
|
+
<script type="text/javascript" charset="utf-8">
|
11
|
+
relpath = '';
|
12
|
+
if (relpath != '') relpath += '/';
|
13
|
+
</script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<script type="text/javascript" charset="utf-8">
|
20
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<div id="header">
|
24
|
+
<div id="menu">
|
25
|
+
|
26
|
+
<a href="_index.html" title="Index">Index</a> »
|
27
|
+
<span class="title">File: README</span>
|
28
|
+
|
29
|
+
|
30
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div id="search">
|
34
|
+
<a id="class_list_link" href="#">Class List</a>
|
35
|
+
<a id="method_list_link" href="#">Method List</a>
|
36
|
+
<a id ="file_list_link" href="#">File List</a>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="clear"></div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<iframe id="search_frame"></iframe>
|
43
|
+
|
44
|
+
<div id="content"><div id='filecontents'><h1>Magpie用于模拟支付平台的沙盒功能</h1>
|
45
|
+
|
46
|
+
<p><strong>Git</strong>: <a href="http://github.com/baya/magpie">http://github.com/baya/magpie</a></p>
|
47
|
+
|
48
|
+
<p><strong>Author</strong>: Guimin Jiang</p>
|
49
|
+
|
50
|
+
<p><strong>Copyright</strong>: 2010</p>
|
51
|
+
|
52
|
+
<p><strong>License</strong>: MIT License</p>
|
53
|
+
|
54
|
+
<p><strong>Latest Version</strong>: 0.8.6.2</p>
|
55
|
+
|
56
|
+
<p><strong>Release Date</strong>: 2010-10-20</p>
|
57
|
+
|
58
|
+
<h2>快搭</h2>
|
59
|
+
|
60
|
+
<pre class="code"><span class='sudo identifier id'>sudo</span> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='magpie identifier id'>magpie</span>
|
61
|
+
</pre>
|
62
|
+
|
63
|
+
<p>打开终端,输入:</p>
|
64
|
+
|
65
|
+
<pre class="code">$ <span class='mag identifier id'>mag</span> <span class='magpie identifier id'>magpie</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
66
|
+
</pre>
|
67
|
+
|
68
|
+
<p>magpie.yml文件用来配置你的商号信息, 假设你在支付宝有个账号:123456, key是:aaabbb, 网银在线有个账号:789789, key是:cccddd, 那么你在magpie.yml中这样写,</p>
|
69
|
+
|
70
|
+
<pre class="code"><span class='alipay identifier id'>alipay</span><span class='colon op'>:</span>
|
71
|
+
<span class='minus op'>-</span> <span class='lbrack token'>[</span><span class='string val'>"123456"</span><span class='comma token'>,</span> <span class='string val'>"aaabbb"</span><span class='rbrack token'>]</span>
|
72
|
+
|
73
|
+
<span class='chinabank identifier id'>chinabank</span><span class='colon op'>:</span>
|
74
|
+
<span class='minus op'>-</span> <span class='lbrack token'>[</span><span class='string val'>"789789"</span><span class='comma token'>,</span> <span class='string val'>"cccddd"</span><span class='rbrack token'>]</span>
|
75
|
+
</pre>
|
76
|
+
|
77
|
+
<p><strong>注意!</strong> 如果你输入mag命令报错, 那可能是因为你的电脑缺少一些magpie需要的gem包, 试着使用下面的命令:</p>
|
78
|
+
|
79
|
+
<pre class="code">$ <span class='sudo identifier id'>sudo</span> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='activemode identifier id'>activemode</span>
|
80
|
+
$ <span class='sudo identifier id'>sudo</span> <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='hpricot identifier id'>hpricot</span>
|
81
|
+
</pre>
|
82
|
+
|
83
|
+
<p>mag命令默认会在本地9292端口启动http服务, 你可以用-p选项指定端口</p>
|
84
|
+
|
85
|
+
<pre class="code"><span class='mag identifier id'>mag</span> <span class='minus op'>-</span><span class='p identifier id'>p</span> <span class='integer val'>2010</span> <span class='magpie identifier id'>magpie</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
86
|
+
</pre>
|
87
|
+
|
88
|
+
<p>mag命令的更多选项可以通过<code>mag -h</code>查看</p>
|
89
|
+
|
90
|
+
<h2>使用示例</h2>
|
91
|
+
|
92
|
+
<p>假设你正在实现支付宝支付的相关代码, 首先启动magpie服务</p>
|
93
|
+
|
94
|
+
<pre class="code">$ <span class='mag identifier id'>mag</span> <span class='magpie identifier id'>magpie</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span>
|
95
|
+
</pre>
|
96
|
+
|
97
|
+
<p>然后在你开发的商户系统中将支付网关由支付宝的网关<code>https://www.alipay.com/cooperate/gateway.do</code>更改为magpie的网关<code>http://127.0.0.1:9292/alipay</code></p>
|
98
|
+
|
99
|
+
<p>如果你请求的参数出现错误,你可以通过magpie的日志查看到详细的出错信息, 或者在浏览器上查看出错信息(以xml的格式显示)</p>
|
100
|
+
|
101
|
+
<p>如果你的支付请求成功magpie将会模拟支付宝的主动通知模式, 给你商户系统发送通知, 你需要确保发送给magpie的<code>notify_url</code></p>
|
102
|
+
|
103
|
+
<p>是可用的,magpie将通过这个<code>notify_url</code>将支付成功的通知发到你的商户系统中, 这样你就可以避免去支付宝的页面进行真实的支付.</p>
|
104
|
+
|
105
|
+
<p>对于网银在线, 将支付网关由网银在线的网关<code>https://pay3.chinabank.com.cn/PayGate</code>更改为magpie的网关<code>http://127.0.0.1:9292/chinabank</code></p>
|
106
|
+
|
107
|
+
<h2>支持的支付平台</h2>
|
108
|
+
|
109
|
+
<ul>
|
110
|
+
<li>支付宝(alipay)</li>
|
111
|
+
<li>网银在线(chinabank)</li>
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
|
115
|
+
<h2>使用的项目</h2>
|
116
|
+
|
117
|
+
<ul>
|
118
|
+
<li><a href="http://piao.fantong.com">饭票</a></li>
|
119
|
+
<li><a href="http://tuan.fantong.com">饭团</a></li>
|
120
|
+
</ul>
|
121
|
+
|
122
|
+
|
123
|
+
<h2>感谢</h2>
|
124
|
+
|
125
|
+
<ul>
|
126
|
+
<li>potian <a href="http://www.javaeye.com/topic/605707">Rack编程</a>的作者</li>
|
127
|
+
<li>liuzihua</li>
|
128
|
+
</ul>
|
129
|
+
|
130
|
+
|
131
|
+
<h2>Changelog</h2>
|
132
|
+
|
133
|
+
<ul>
|
134
|
+
<li><p><strong>2010-10-20</strong>: 0.8.6.1 release</p>
|
135
|
+
|
136
|
+
<ul>
|
137
|
+
<li>支持网银在线</li>
|
138
|
+
</ul>
|
139
|
+
</li>
|
140
|
+
<li><p><strong>2010-10-20</strong>: 0.8.6.1 release</p>
|
141
|
+
|
142
|
+
<ul>
|
143
|
+
<li>改善README.md的可阅读性</li>
|
144
|
+
</ul>
|
145
|
+
</li>
|
146
|
+
</ul>
|
147
|
+
|
148
|
+
|
149
|
+
<h2>Copyright</h2>
|
150
|
+
|
151
|
+
<p>MAGPIE © 2007-2010 by <a href="mailto:kayak.jiang@gmail.com">Guimin Jiang</a>.
|
152
|
+
MAGPIE is licensed under the MIT license except for some files which come
|
153
|
+
from the RDoc/Ruby distributions. Please see the <a href="file.COPYING.html" title="COPYING">COPYING</a> documents for more information.</p></div></div>
|
154
|
+
|
155
|
+
<div id="footer">
|
156
|
+
Generated on Thu Oct 21 14:14:14 2010 by
|
157
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
158
|
+
0.6.1 (ruby-1.8.7).
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</body>
|
162
|
+
</html>
|