jyt_pay 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +72 -0
- data/Rakefile +16 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/JytPay/Api/AuthCard.html +375 -0
- data/doc/JytPay/Api/QueryBalance.html +299 -0
- data/doc/JytPay/Api/QueryOrder.html +372 -0
- data/doc/JytPay/Api/QuickDraw.html +433 -0
- data/doc/JytPay/Api/QuickPay.html +435 -0
- data/doc/JytPay/Api.html +117 -0
- data/doc/JytPay/Client.html +323 -0
- data/doc/JytPay/Encrypt/Des.html +258 -0
- data/doc/JytPay/Encrypt/Rsa.html +232 -0
- data/doc/JytPay/Encrypt.html +127 -0
- data/doc/JytPay/Http/RetCode.html +391 -0
- data/doc/JytPay/Http.html +242 -0
- data/doc/JytPay/Sign/Rsa.html +178 -0
- data/doc/JytPay/Sign.html +115 -0
- data/doc/JytPay/Utils.html +358 -0
- data/doc/JytPay/Xml/MyPrecious.html +220 -0
- data/doc/JytPay/Xml.html +210 -0
- data/doc/JytPay.html +140 -0
- data/doc/_index.html +317 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +492 -0
- data/doc/file.README.html +150 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +150 -0
- data/doc/js/app.js +248 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +203 -0
- data/doc/top-level-namespace.html +110 -0
- data/jyt_pay.gemspec +34 -0
- data/lib/jyt_pay/api/auth_card.rb +60 -0
- data/lib/jyt_pay/api/query_balance.rb +50 -0
- data/lib/jyt_pay/api/query_order.rb +71 -0
- data/lib/jyt_pay/api/quick_draw.rb +75 -0
- data/lib/jyt_pay/api/quick_pay.rb +76 -0
- data/lib/jyt_pay/client.rb +37 -0
- data/lib/jyt_pay/encrypt/des.rb +30 -0
- data/lib/jyt_pay/encrypt/encrypt.rb +7 -0
- data/lib/jyt_pay/encrypt/rsa.rb +20 -0
- data/lib/jyt_pay/http/communicate.rb +77 -0
- data/lib/jyt_pay/http/ret_code.rb +60 -0
- data/lib/jyt_pay/sign/rsa.rb +14 -0
- data/lib/jyt_pay/utils.rb +42 -0
- data/lib/jyt_pay/version.rb +3 -0
- data/lib/jyt_pay/xml/xml.rb +74 -0
- data/lib/jyt_pay.rb +32 -0
- metadata +166 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8183ae37df73a3047fb83074b9165e0a67dd42e2
|
4
|
+
data.tar.gz: ce06adb7823d7aa85154a03d09fad3faed781203
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d739732e1140662d7f444d527c8ff0b112ed54078359b1f204a36ddd8170bfd2eaa40d1dbe9887baac25c63b7320a64b4c3e78857fb0cd1c080a509ca793f2ee
|
7
|
+
data.tar.gz: 0bca2c9cd2ffad5f3899234f6624bb3952c4c79a24d2dfab93d07baef1abfeb1384ea5d39733db2a26d7e827b69dcf9cfa3b40413bb1010a5db73625512f6cc0
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at tony@omniaccount.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 tony
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# JytPay
|
2
|
+
|
3
|
+
金运通支付 API ruby sdk,目前提供以下接口(具体可以看 doc 中 `API` 一节)
|
4
|
+
|
5
|
+
1. 四要素认证
|
6
|
+
2. 商户余额查询
|
7
|
+
3. 代扣请求接口
|
8
|
+
4. 代付请求接口
|
9
|
+
5. 查询代扣代付订单
|
10
|
+
|
11
|
+
## 安装
|
12
|
+
|
13
|
+
Gemfile 中增加:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'jyt_pay'
|
17
|
+
```
|
18
|
+
|
19
|
+
然后执行命令:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
或者直接安装:
|
24
|
+
|
25
|
+
$ gem install jyt_pay
|
26
|
+
|
27
|
+
## 快速指南
|
28
|
+
|
29
|
+
1. 初始化
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
client = JytPay::Client.new(merchant_id: merchant_id,
|
33
|
+
mer_viral_acct: mer_viral_acct,
|
34
|
+
auth_url: auth_url,
|
35
|
+
pay_url: pay_url,
|
36
|
+
draw_url: draw_url,
|
37
|
+
query_balance_url: query_balance_url,
|
38
|
+
private_key: private_key,
|
39
|
+
jyt_public_key: jyt_public_key)
|
40
|
+
```
|
41
|
+
|
42
|
+
2. 调用各个 api,比如查询接口:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
client.query_balance(商户自定义唯一订单号)
|
46
|
+
```
|
47
|
+
|
48
|
+
## TODO
|
49
|
+
|
50
|
+
1. 验签
|
51
|
+
2. 替换 REXML
|
52
|
+
3. 动态加载 api
|
53
|
+
4. included 用 ActiveSupport 里的
|
54
|
+
|
55
|
+
## Contributing
|
56
|
+
|
57
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jyt_pay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
58
|
+
|
59
|
+
## Make a pull request
|
60
|
+
|
61
|
+
1. Fork it
|
62
|
+
2. Create your feature branch (git checkout -b my-new-feature)
|
63
|
+
3. Commit your changes (git commit -am 'Add some feature')
|
64
|
+
4. Push to the branch (git push origin my-new-feature)
|
65
|
+
5. Create new Pull Request
|
66
|
+
6. Please write unit test with your code if necessary.
|
67
|
+
|
68
|
+
|
69
|
+
## License
|
70
|
+
|
71
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
72
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task :default => :spec
|
7
|
+
|
8
|
+
task :build do
|
9
|
+
puts `gem build jyt_pay.gemspec`
|
10
|
+
end
|
11
|
+
|
12
|
+
task :push do
|
13
|
+
puts `gem push jyt_pay-#{JytPay::VERSION}.gem`
|
14
|
+
end
|
15
|
+
|
16
|
+
task :publish => [:build, :push]
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "jyt_pay"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,375 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: JytPay::Api::AuthCard
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "JytPay::Api::AuthCard";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (A)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../JytPay.html" title="JytPay (module)">JytPay</a></span></span> » <span class='title'><span class='object_link'><a href="../Api.html" title="JytPay::Api (module)">Api</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">AuthCard</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: JytPay::Api::AuthCard
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="../Client.html" title="JytPay::Client (class)">Client</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/jyt_pay/api/auth_card.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
<h2>Constant Summary</h2>
|
93
|
+
<dl class="constants">
|
94
|
+
|
95
|
+
<dt id="AUTH_CARD_TRAN_CODE-constant" class="">AUTH_CARD_TRAN_CODE =
|
96
|
+
|
97
|
+
</dt>
|
98
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>TR4003</span><span class='tstring_end'>"</span></span></pre></dd>
|
99
|
+
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#auth_card-instance_method" title="#auth_card (instance method)">#<strong>auth_card</strong>(flow_id, card_id, true_name, identity_id, phone) ⇒ Hash </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'>
|
134
|
+
<p>四要素认证.</p>
|
135
|
+
</div></span>
|
136
|
+
|
137
|
+
</li>
|
138
|
+
|
139
|
+
|
140
|
+
</ul>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<div id="instance_method_details" class="method_details_list">
|
146
|
+
<h2>Instance Method Details</h2>
|
147
|
+
|
148
|
+
|
149
|
+
<div class="method_details first">
|
150
|
+
<h3 class="signature first" id="auth_card-instance_method">
|
151
|
+
|
152
|
+
#<strong>auth_card</strong>(flow_id, card_id, true_name, identity_id, phone) ⇒ <tt>Hash</tt>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
</h3><div class="docstring">
|
159
|
+
<div class="discussion">
|
160
|
+
|
161
|
+
<p>四要素认证</p>
|
162
|
+
|
163
|
+
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
<div class="tags">
|
167
|
+
<p class="tag_title">Parameters:</p>
|
168
|
+
<ul class="param">
|
169
|
+
|
170
|
+
<li>
|
171
|
+
|
172
|
+
<span class='name'>flow_id</span>
|
173
|
+
|
174
|
+
|
175
|
+
<span class='type'>(<tt>String</tt>)</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
—
|
180
|
+
<div class='inline'>
|
181
|
+
<p>订单号</p>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
</li>
|
185
|
+
|
186
|
+
<li>
|
187
|
+
|
188
|
+
<span class='name'>card_id</span>
|
189
|
+
|
190
|
+
|
191
|
+
<span class='type'>(<tt>String</tt>)</span>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
—
|
196
|
+
<div class='inline'>
|
197
|
+
<p>银行卡号</p>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
</li>
|
201
|
+
|
202
|
+
<li>
|
203
|
+
|
204
|
+
<span class='name'>true_name</span>
|
205
|
+
|
206
|
+
|
207
|
+
<span class='type'>(<tt>String</tt>)</span>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
—
|
212
|
+
<div class='inline'>
|
213
|
+
<p>真实姓名</p>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
</li>
|
217
|
+
|
218
|
+
<li>
|
219
|
+
|
220
|
+
<span class='name'>identity_id</span>
|
221
|
+
|
222
|
+
|
223
|
+
<span class='type'>(<tt>String</tt>)</span>
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
—
|
228
|
+
<div class='inline'>
|
229
|
+
<p>身份证</p>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
</li>
|
233
|
+
|
234
|
+
<li>
|
235
|
+
|
236
|
+
<span class='name'>phone</span>
|
237
|
+
|
238
|
+
|
239
|
+
<span class='type'>(<tt>String</tt>)</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
—
|
244
|
+
<div class='inline'>
|
245
|
+
<p>银行卡预留手机号</p>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</li>
|
249
|
+
|
250
|
+
</ul>
|
251
|
+
|
252
|
+
<p class="tag_title">Returns:</p>
|
253
|
+
<ul class="return">
|
254
|
+
|
255
|
+
<li>
|
256
|
+
|
257
|
+
|
258
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
—
|
263
|
+
<div class='inline'>
|
264
|
+
<p>结果集</p>
|
265
|
+
<ul><li>
|
266
|
+
<p>:result [String] 是否成功,`F`, `S`</p>
|
267
|
+
</li><li>
|
268
|
+
<p>:bank_name [String] 成功后会返回该卡在 jyt 系统内的中文名</p>
|
269
|
+
</li><li>
|
270
|
+
<p>:msg [String] 结果说明</p>
|
271
|
+
</li><li>
|
272
|
+
<p>:ret_code [String] 结果 CODE</p>
|
273
|
+
</li><li>
|
274
|
+
<p>:flow_id [String] 订单号</p>
|
275
|
+
</li><li>
|
276
|
+
<p>:request_body [String] 请求报文</p>
|
277
|
+
</li><li>
|
278
|
+
<p>:response_body [String] 响应报文</p>
|
279
|
+
</li></ul>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
</ul>
|
285
|
+
|
286
|
+
</div><table class="source_code">
|
287
|
+
<tr>
|
288
|
+
<td>
|
289
|
+
<pre class="lines">
|
290
|
+
|
291
|
+
|
292
|
+
26
|
293
|
+
27
|
294
|
+
28
|
295
|
+
29
|
296
|
+
30
|
297
|
+
31
|
298
|
+
32
|
299
|
+
33
|
300
|
+
34
|
301
|
+
35
|
302
|
+
36
|
303
|
+
37
|
304
|
+
38
|
305
|
+
39
|
306
|
+
40
|
307
|
+
41
|
308
|
+
42
|
309
|
+
43
|
310
|
+
44
|
311
|
+
45
|
312
|
+
46
|
313
|
+
47
|
314
|
+
48
|
315
|
+
49
|
316
|
+
50
|
317
|
+
51
|
318
|
+
52
|
319
|
+
53
|
320
|
+
54
|
321
|
+
55
|
322
|
+
56</pre>
|
323
|
+
</td>
|
324
|
+
<td>
|
325
|
+
<pre class="code"><span class="info file"># File 'lib/jyt_pay/api/auth_card.rb', line 26</span>
|
326
|
+
|
327
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_auth_card'>auth_card</span><span class='lparen'>(</span><span class='id identifier rubyid_flow_id'>flow_id</span><span class='comma'>,</span> <span class='id identifier rubyid_card_id'>card_id</span><span class='comma'>,</span> <span class='id identifier rubyid_true_name'>true_name</span><span class='comma'>,</span> <span class='id identifier rubyid_identity_id'>identity_id</span><span class='comma'>,</span> <span class='id identifier rubyid_phone'>phone</span><span class='rparen'>)</span>
|
328
|
+
|
329
|
+
<span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
330
|
+
<span class='label'>bank_card_no:</span> <span class='id identifier rubyid_card_id'>card_id</span><span class='comma'>,</span>
|
331
|
+
<span class='label'>id_num:</span> <span class='id identifier rubyid_identity_id'>identity_id</span><span class='comma'>,</span>
|
332
|
+
<span class='label'>id_name:</span> <span class='id identifier rubyid_true_name'>true_name</span><span class='comma'>,</span>
|
333
|
+
<span class='label'>terminal_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>01</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
334
|
+
<span class='label'>bank_card_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>D</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
335
|
+
<span class='label'>phone_no:</span> <span class='id identifier rubyid_phone'>phone</span><span class='comma'>,</span>
|
336
|
+
<span class='rbrace'>}</span>
|
337
|
+
|
338
|
+
<span class='id identifier rubyid_xml_str'>xml_str</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../JytPay.html" title="JytPay (module)">JytPay</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Xml.html" title="JytPay::Xml (module)">Xml</a></span></span><span class='period'>.</span><span class='id identifier rubyid_generate'><span class='object_link'><a href="../Xml.html#generate-class_method" title="JytPay::Xml.generate (method)">generate</a></span></span><span class='lparen'>(</span><span class='ivar'>@merchant_id</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#AUTH_CARD_TRAN_CODE-constant" title="JytPay::Api::AuthCard::AUTH_CARD_TRAN_CODE (constant)">AUTH_CARD_TRAN_CODE</a></span></span><span class='comma'>,</span>
|
339
|
+
<span class='id identifier rubyid_params'>params</span><span class='comma'>,</span> <span class='id identifier rubyid_flow_id'>flow_id</span><span class='rparen'>)</span>
|
340
|
+
|
341
|
+
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Http.html" title="JytPay::Http (module)">Http</a></span></span><span class='period'>.</span><span class='id identifier rubyid_post'><span class='object_link'><a href="../Http.html#post-class_method" title="JytPay::Http.post (method)">post</a></span></span><span class='lparen'>(</span><span class='ivar'>@merchant_id</span><span class='comma'>,</span> <span class='ivar'>@uris</span><span class='lbracket'>[</span><span class='symbol'>:auth</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
342
|
+
<span class='const'><span class='object_link'><a href="#AUTH_CARD_TRAN_CODE-constant" title="JytPay::Api::AuthCard::AUTH_CARD_TRAN_CODE (constant)">AUTH_CARD_TRAN_CODE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_xml_str'>xml_str</span><span class='comma'>,</span>
|
343
|
+
<span class='ivar'>@rsa_private_key</span><span class='comma'>,</span> <span class='ivar'>@rsa_jyt_public_key</span><span class='rparen'>)</span>
|
344
|
+
|
345
|
+
<span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
346
|
+
<span class='label'>result:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>S0000000</span><span class='tstring_end'>'</span></span> <span class='op'>==</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:head</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:resp_code</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>S</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>F</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
347
|
+
<span class='label'>bank_name:</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:body</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:bank_name</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
348
|
+
<span class='label'>msg:</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:head</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:resp_desc</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
349
|
+
<span class='label'>ret_code:</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:head</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:resp_code</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
350
|
+
<span class='label'>flow_id:</span> <span class='id identifier rubyid_flow_id'>flow_id</span><span class='comma'>,</span>
|
351
|
+
<span class='label'>vendor_order_id:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='comment'># jyt 不会返回他们的订单号
|
352
|
+
</span> <span class='label'>request_body:</span> <span class='id identifier rubyid_xml_str'>xml_str</span><span class='comma'>,</span>
|
353
|
+
<span class='label'>response_body:</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='symbol'>:xml_str</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
354
|
+
<span class='rbrace'>}</span>
|
355
|
+
|
356
|
+
<span class='id identifier rubyid_res'>res</span>
|
357
|
+
<span class='kw'>end</span></pre>
|
358
|
+
</td>
|
359
|
+
</tr>
|
360
|
+
</table>
|
361
|
+
</div>
|
362
|
+
|
363
|
+
</div>
|
364
|
+
|
365
|
+
</div>
|
366
|
+
|
367
|
+
<div id="footer">
|
368
|
+
Generated on Thu Nov 2 20:02:48 2017 by
|
369
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
370
|
+
0.9.9 (ruby-2.3.5).
|
371
|
+
</div>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
</body>
|
375
|
+
</html>
|