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.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +49 -0
  6. data/Gemfile +6 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +72 -0
  9. data/Rakefile +16 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/doc/JytPay/Api/AuthCard.html +375 -0
  13. data/doc/JytPay/Api/QueryBalance.html +299 -0
  14. data/doc/JytPay/Api/QueryOrder.html +372 -0
  15. data/doc/JytPay/Api/QuickDraw.html +433 -0
  16. data/doc/JytPay/Api/QuickPay.html +435 -0
  17. data/doc/JytPay/Api.html +117 -0
  18. data/doc/JytPay/Client.html +323 -0
  19. data/doc/JytPay/Encrypt/Des.html +258 -0
  20. data/doc/JytPay/Encrypt/Rsa.html +232 -0
  21. data/doc/JytPay/Encrypt.html +127 -0
  22. data/doc/JytPay/Http/RetCode.html +391 -0
  23. data/doc/JytPay/Http.html +242 -0
  24. data/doc/JytPay/Sign/Rsa.html +178 -0
  25. data/doc/JytPay/Sign.html +115 -0
  26. data/doc/JytPay/Utils.html +358 -0
  27. data/doc/JytPay/Xml/MyPrecious.html +220 -0
  28. data/doc/JytPay/Xml.html +210 -0
  29. data/doc/JytPay.html +140 -0
  30. data/doc/_index.html +317 -0
  31. data/doc/class_list.html +51 -0
  32. data/doc/css/common.css +1 -0
  33. data/doc/css/full_list.css +58 -0
  34. data/doc/css/style.css +492 -0
  35. data/doc/file.README.html +150 -0
  36. data/doc/file_list.html +56 -0
  37. data/doc/frames.html +17 -0
  38. data/doc/index.html +150 -0
  39. data/doc/js/app.js +248 -0
  40. data/doc/js/full_list.js +216 -0
  41. data/doc/js/jquery.js +4 -0
  42. data/doc/method_list.html +203 -0
  43. data/doc/top-level-namespace.html +110 -0
  44. data/jyt_pay.gemspec +34 -0
  45. data/lib/jyt_pay/api/auth_card.rb +60 -0
  46. data/lib/jyt_pay/api/query_balance.rb +50 -0
  47. data/lib/jyt_pay/api/query_order.rb +71 -0
  48. data/lib/jyt_pay/api/quick_draw.rb +75 -0
  49. data/lib/jyt_pay/api/quick_pay.rb +76 -0
  50. data/lib/jyt_pay/client.rb +37 -0
  51. data/lib/jyt_pay/encrypt/des.rb +30 -0
  52. data/lib/jyt_pay/encrypt/encrypt.rb +7 -0
  53. data/lib/jyt_pay/encrypt/rsa.rb +20 -0
  54. data/lib/jyt_pay/http/communicate.rb +77 -0
  55. data/lib/jyt_pay/http/ret_code.rb +60 -0
  56. data/lib/jyt_pay/sign/rsa.rb +14 -0
  57. data/lib/jyt_pay/utils.rb +42 -0
  58. data/lib/jyt_pay/version.rb +3 -0
  59. data/lib/jyt_pay/xml/xml.rb +74 -0
  60. data/lib/jyt_pay.rb +32 -0
  61. metadata +166 -0
@@ -0,0 +1,323 @@
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
+ Class: JytPay::Client
8
+
9
+ &mdash; 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::Client";
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 (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../JytPay.html" title="JytPay (module)">JytPay</a></span></span>
41
+ &raquo;
42
+ <span class="title">Client</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>Class: JytPay::Client
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">JytPay::Client</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd><span class='object_link'><a href="Api/AuthCard.html" title="JytPay::Api::AuthCard (module)">Api::AuthCard</a></span>, <span class='object_link'><a href="Api/QueryBalance.html" title="JytPay::Api::QueryBalance (module)">Api::QueryBalance</a></span>, <span class='object_link'><a href="Api/QueryOrder.html" title="JytPay::Api::QueryOrder (module)">Api::QueryOrder</a></span>, <span class='object_link'><a href="Api/QuickDraw.html" title="JytPay::Api::QuickDraw (module)">Api::QuickDraw</a></span>, <span class='object_link'><a href="Api/QuickPay.html" title="JytPay::Api::QuickPay (module)">Api::QuickPay</a></span></dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/jyt_pay/client.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+
108
+
109
+
110
+ <h2>Constant Summary</h2>
111
+
112
+ <h3 class="inherited">Constants included
113
+ from <span class='object_link'><a href="Api/AuthCard.html" title="JytPay::Api::AuthCard (module)">Api::AuthCard</a></span></h3>
114
+ <p class="inherited"><span class='object_link'><a href="Api/AuthCard.html#AUTH_CARD_TRAN_CODE-constant" title="JytPay::Api::AuthCard::AUTH_CARD_TRAN_CODE (constant)">Api::AuthCard::AUTH_CARD_TRAN_CODE</a></span></p>
115
+
116
+
117
+
118
+ <h3 class="inherited">Constants included
119
+ from <span class='object_link'><a href="Api/QueryBalance.html" title="JytPay::Api::QueryBalance (module)">Api::QueryBalance</a></span></h3>
120
+ <p class="inherited"><span class='object_link'><a href="Api/QueryBalance.html#QUERY_BALANCE_TRAN_CODE-constant" title="JytPay::Api::QueryBalance::QUERY_BALANCE_TRAN_CODE (constant)">Api::QueryBalance::QUERY_BALANCE_TRAN_CODE</a></span></p>
121
+
122
+
123
+
124
+ <h3 class="inherited">Constants included
125
+ from <span class='object_link'><a href="Api/QueryOrder.html" title="JytPay::Api::QueryOrder (module)">Api::QueryOrder</a></span></h3>
126
+ <p class="inherited"><span class='object_link'><a href="Api/QueryOrder.html#QUERY_DRAW_TRAN_CODE-constant" title="JytPay::Api::QueryOrder::QUERY_DRAW_TRAN_CODE (constant)">Api::QueryOrder::QUERY_DRAW_TRAN_CODE</a></span>, <span class='object_link'><a href="Api/QueryOrder.html#QUERY_PAY_TRAN_CODE-constant" title="JytPay::Api::QueryOrder::QUERY_PAY_TRAN_CODE (constant)">Api::QueryOrder::QUERY_PAY_TRAN_CODE</a></span></p>
127
+
128
+
129
+
130
+ <h3 class="inherited">Constants included
131
+ from <span class='object_link'><a href="Api/QuickDraw.html" title="JytPay::Api::QuickDraw (module)">Api::QuickDraw</a></span></h3>
132
+ <p class="inherited"><span class='object_link'><a href="Api/QuickDraw.html#QUICK_DRAW_TRAN_CODE-constant" title="JytPay::Api::QuickDraw::QUICK_DRAW_TRAN_CODE (constant)">Api::QuickDraw::QUICK_DRAW_TRAN_CODE</a></span></p>
133
+
134
+
135
+
136
+ <h3 class="inherited">Constants included
137
+ from <span class='object_link'><a href="Api/QuickPay.html" title="JytPay::Api::QuickPay (module)">Api::QuickPay</a></span></h3>
138
+ <p class="inherited"><span class='object_link'><a href="Api/QuickPay.html#QUICK_PAY_TRAN_CODE-constant" title="JytPay::Api::QuickPay::QUICK_PAY_TRAN_CODE (constant)">Api::QuickPay::QUICK_PAY_TRAN_CODE</a></span></p>
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <h2>
146
+ Instance Method Summary
147
+ <small><a href="#" class="summary_toggle">collapse</a></small>
148
+ </h2>
149
+
150
+ <ul class="summary">
151
+
152
+ <li class="public ">
153
+ <span class="summary_signature">
154
+
155
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options_arg) &#x21d2; Client </a>
156
+
157
+
158
+
159
+ </span>
160
+
161
+
162
+ <span class="note title constructor">constructor</span>
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>A new instance of Client.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ </ul>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Api/AuthCard.html" title="JytPay::Api::AuthCard (module)">Api::AuthCard</a></span></h3>
191
+ <p class="inherited"><span class='object_link'><a href="Api/AuthCard.html#auth_card-instance_method" title="JytPay::Api::AuthCard#auth_card (method)">#auth_card</a></span></p>
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Api/QueryBalance.html" title="JytPay::Api::QueryBalance (module)">Api::QueryBalance</a></span></h3>
202
+ <p class="inherited"><span class='object_link'><a href="Api/QueryBalance.html#query_balance-instance_method" title="JytPay::Api::QueryBalance#query_balance (method)">#query_balance</a></span></p>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Api/QueryOrder.html" title="JytPay::Api::QueryOrder (module)">Api::QueryOrder</a></span></h3>
213
+ <p class="inherited"><span class='object_link'><a href="Api/QueryOrder.html#query_order-instance_method" title="JytPay::Api::QueryOrder#query_order (method)">#query_order</a></span></p>
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Api/QuickDraw.html" title="JytPay::Api::QuickDraw (module)">Api::QuickDraw</a></span></h3>
224
+ <p class="inherited"><span class='object_link'><a href="Api/QuickDraw.html#quick_draw-instance_method" title="JytPay::Api::QuickDraw#quick_draw (method)">#quick_draw</a></span></p>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Api/QuickPay.html" title="JytPay::Api::QuickPay (module)">Api::QuickPay</a></span></h3>
235
+ <p class="inherited"><span class='object_link'><a href="Api/QuickPay.html#quick_pay-instance_method" title="JytPay::Api::QuickPay#quick_pay (method)">#quick_pay</a></span></p>
236
+ <div id="constructor_details" class="method_details_list">
237
+ <h2>Constructor Details</h2>
238
+
239
+ <div class="method_details first">
240
+ <h3 class="signature first" id="initialize-instance_method">
241
+
242
+ #<strong>initialize</strong>(options_arg) &#x21d2; <tt><span class='object_link'><a href="" title="JytPay::Client (class)">Client</a></span></tt>
243
+
244
+
245
+
246
+
247
+
248
+ </h3><div class="docstring">
249
+ <div class="discussion">
250
+
251
+ <p>Returns a new instance of Client</p>
252
+
253
+
254
+ </div>
255
+ </div>
256
+ <div class="tags">
257
+
258
+
259
+ </div><table class="source_code">
260
+ <tr>
261
+ <td>
262
+ <pre class="lines">
263
+
264
+
265
+ 17
266
+ 18
267
+ 19
268
+ 20
269
+ 21
270
+ 22
271
+ 23
272
+ 24
273
+ 25
274
+ 26
275
+ 27
276
+ 28
277
+ 29
278
+ 30
279
+ 31
280
+ 32
281
+ 33
282
+ 34</pre>
283
+ </td>
284
+ <td>
285
+ <pre class="code"><span class="info file"># File 'lib/jyt_pay/client.rb', line 17</span>
286
+
287
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options_arg'>options_arg</span><span class='rparen'>)</span>
288
+ <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Utils.html" title="JytPay::Utils (module)">Utils</a></span></span><span class='period'>.</span><span class='id identifier rubyid_symbolize_keys'><span class='object_link'><a href="Utils.html#symbolize_keys-class_method" title="JytPay::Utils.symbolize_keys (method)">symbolize_keys</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options_arg'>options_arg</span><span class='rparen'>)</span>
289
+
290
+ <span class='ivar'>@uris</span> <span class='op'>=</span> <span class='lbrace'>{</span>
291
+ <span class='label'>pay:</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:pay_url</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
292
+ <span class='label'>draw:</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:draw_url</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
293
+ <span class='label'>auth:</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:auth_url</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
294
+ <span class='label'>query_balance:</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:query_balance_url</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span>
295
+ <span class='rbrace'>}</span>
296
+
297
+ <span class='ivar'>@merchant_id</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:merchant_id</span><span class='rbracket'>]</span>
298
+ <span class='ivar'>@mer_viral_acct</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:mer_viral_acct</span><span class='rbracket'>]</span>
299
+ <span class='ivar'>@private_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:private_key</span><span class='rbracket'>]</span>
300
+ <span class='ivar'>@jyt_public_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:jyt_public_key</span><span class='rbracket'>]</span>
301
+
302
+ <span class='ivar'>@rsa_private_key</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKey</span><span class='op'>::</span><span class='const'>RSA</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@private_key</span><span class='rparen'>)</span>
303
+ <span class='ivar'>@rsa_jyt_public_key</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKey</span><span class='op'>::</span><span class='const'>RSA</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@jyt_public_key</span><span class='rparen'>)</span>
304
+ <span class='kw'>end</span></pre>
305
+ </td>
306
+ </tr>
307
+ </table>
308
+ </div>
309
+
310
+ </div>
311
+
312
+
313
+ </div>
314
+
315
+ <div id="footer">
316
+ Generated on Thu Nov 2 20:02:48 2017 by
317
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
318
+ 0.9.9 (ruby-2.3.5).
319
+ </div>
320
+
321
+ </div>
322
+ </body>
323
+ </html>
@@ -0,0 +1,258 @@
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::Encrypt::Des
8
+
9
+ &mdash; 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::Encrypt::Des";
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 (D)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../JytPay.html" title="JytPay (module)">JytPay</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Encrypt.html" title="JytPay::Encrypt (module)">Encrypt</a></span></span>
41
+ &raquo;
42
+ <span class="title">Des</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::Encrypt::Des
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/jyt_pay/encrypt/des.rb</dd>
82
+ </dl>
83
+
84
+ </div>
85
+
86
+
87
+ <h2>Constant Summary</h2>
88
+ <dl class="constants">
89
+
90
+ <dt id="ALG-constant" class="">ALG =
91
+
92
+ </dt>
93
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>DES-CBC</span><span class='tstring_end'>&#39;</span></span></pre></dd>
94
+
95
+ </dl>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ <h2>
105
+ Class Method Summary
106
+ <small><a href="#" class="summary_toggle">collapse</a></small>
107
+ </h2>
108
+
109
+ <ul class="summary">
110
+
111
+ <li class="public ">
112
+ <span class="summary_signature">
113
+
114
+ <a href="#decrypt-class_method" title="decrypt (class method)">.<strong>decrypt</strong>(xml_enc, key_str) &#x21d2; Object </a>
115
+
116
+
117
+
118
+ </span>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ <span class="summary_desc"><div class='inline'></div></span>
129
+
130
+ </li>
131
+
132
+
133
+ <li class="public ">
134
+ <span class="summary_signature">
135
+
136
+ <a href="#encrypt-class_method" title="encrypt (class method)">.<strong>encrypt</strong>(str, key_arg = Encrypt::DES_KEY) &#x21d2; Object </a>
137
+
138
+
139
+
140
+ </span>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'></div></span>
151
+
152
+ </li>
153
+
154
+
155
+ </ul>
156
+
157
+
158
+
159
+
160
+ <div id="class_method_details" class="method_details_list">
161
+ <h2>Class Method Details</h2>
162
+
163
+
164
+ <div class="method_details first">
165
+ <h3 class="signature first" id="decrypt-class_method">
166
+
167
+ .<strong>decrypt</strong>(xml_enc, key_str) &#x21d2; <tt>Object</tt>
168
+
169
+
170
+
171
+
172
+
173
+ </h3><table class="source_code">
174
+ <tr>
175
+ <td>
176
+ <pre class="lines">
177
+
178
+
179
+ 18
180
+ 19
181
+ 20
182
+ 21
183
+ 22
184
+ 23
185
+ 24
186
+ 25
187
+ 26</pre>
188
+ </td>
189
+ <td>
190
+ <pre class="code"><span class="info file"># File 'lib/jyt_pay/encrypt/des.rb', line 18</span>
191
+
192
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_decrypt'>decrypt</span><span class='lparen'>(</span><span class='id identifier rubyid_xml_enc'>xml_enc</span><span class='comma'>,</span> <span class='id identifier rubyid_key_str'>key_str</span><span class='rparen'>)</span>
193
+ <span class='id identifier rubyid_xml_str'>xml_str</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_xml_enc'>xml_enc</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_pack'>pack</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>H*</span><span class='tstring_end'>&#39;</span></span>
194
+
195
+ <span class='id identifier rubyid_des'>des</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Cipher</span><span class='op'>::</span><span class='const'>Cipher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#ALG-constant" title="JytPay::Encrypt::Des::ALG (constant)">ALG</a></span></span><span class='rparen'>)</span>
196
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_decrypt'>decrypt</span>
197
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key_str'>key_str</span>
198
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_iv'>iv</span> <span class='op'>=</span> <span class='id identifier rubyid_key_str'>key_str</span>
199
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_xml_str'>xml_str</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_final'>final</span>
200
+ <span class='kw'>end</span></pre>
201
+ </td>
202
+ </tr>
203
+ </table>
204
+ </div>
205
+
206
+ <div class="method_details ">
207
+ <h3 class="signature " id="encrypt-class_method">
208
+
209
+ .<strong>encrypt</strong>(str, key_arg = Encrypt::DES_KEY) &#x21d2; <tt>Object</tt>
210
+
211
+
212
+
213
+
214
+
215
+ </h3><table class="source_code">
216
+ <tr>
217
+ <td>
218
+ <pre class="lines">
219
+
220
+
221
+ 9
222
+ 10
223
+ 11
224
+ 12
225
+ 13
226
+ 14
227
+ 15
228
+ 16</pre>
229
+ </td>
230
+ <td>
231
+ <pre class="code"><span class="info file"># File 'lib/jyt_pay/encrypt/des.rb', line 9</span>
232
+
233
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_encrypt'>encrypt</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='comma'>,</span> <span class='id identifier rubyid_key_arg'>key_arg</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Encrypt.html" title="JytPay::Encrypt (module)">Encrypt</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Encrypt.html#DES_KEY-constant" title="JytPay::Encrypt::DES_KEY (constant)">DES_KEY</a></span></span><span class='rparen'>)</span>
234
+ <span class='id identifier rubyid_des'>des</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Cipher</span><span class='op'>::</span><span class='const'>Cipher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#ALG-constant" title="JytPay::Encrypt::Des::ALG (constant)">ALG</a></span></span><span class='rparen'>)</span>
235
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_key_arg'>key_arg</span>
236
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_iv'>iv</span> <span class='op'>=</span> <span class='id identifier rubyid_key_arg'>key_arg</span>
237
+ <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_encrypt'>encrypt</span>
238
+ <span class='id identifier rubyid_cipher'>cipher</span> <span class='op'>=</span> <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_des'>des</span><span class='period'>.</span><span class='id identifier rubyid_final'>final</span>
239
+ <span class='id identifier rubyid_cipher'>cipher</span><span class='period'>.</span><span class='id identifier rubyid_unpack'>unpack</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>H*</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
240
+ <span class='kw'>end</span></pre>
241
+ </td>
242
+ </tr>
243
+ </table>
244
+ </div>
245
+
246
+ </div>
247
+
248
+ </div>
249
+
250
+ <div id="footer">
251
+ Generated on Thu Nov 2 20:02:48 2017 by
252
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
253
+ 0.9.9 (ruby-2.3.5).
254
+ </div>
255
+
256
+ </div>
257
+ </body>
258
+ </html>