omni_kassa 1.0.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.
@@ -0,0 +1,581 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: OmniKassa::Response</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="../js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="../js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="class">
23
+
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="../index.html">Home</a>
29
+ <a href="../index.html#classes">Classes</a>
30
+ <a href="../index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+
41
+ <li><a href="../lib/omni_kassa/response_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="lib/omni_kassa/response.rb">lib/omni_kassa/response.rb</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+
49
+ </div>
50
+
51
+ <div id="class-metadata">
52
+
53
+ <!-- Parent Class -->
54
+
55
+ <div id="parent-class-section" class="section">
56
+ <h3 class="section-header">Parent</h3>
57
+
58
+ <p class="link">Object</p>
59
+
60
+ </div>
61
+
62
+
63
+ <!-- Namespace Contents -->
64
+
65
+ <div id="namespace-list-section" class="section">
66
+ <h3 class="section-header">Namespace</h3>
67
+ <ul class="link-list">
68
+
69
+ <li><span class="type">CLASS</span> <a href="Response/ResponseCodeError.html">OmniKassa::Response::ResponseCodeError</a></li>
70
+
71
+ <li><span class="type">CLASS</span> <a href="Response/SealMismatchError.html">OmniKassa::Response::SealMismatchError</a></li>
72
+
73
+ </ul>
74
+ </div>
75
+
76
+
77
+ <!-- Method Quickref -->
78
+
79
+ <div id="method-list-section" class="section">
80
+ <h3 class="section-header">Methods</h3>
81
+ <ul class="link-list">
82
+
83
+ <li><a href="#method-c-new">::new</a></li>
84
+
85
+ <li><a href="#method-i-data%3D">#data=</a></li>
86
+
87
+ <li><a href="#method-i-data_hash">#data_hash</a></li>
88
+
89
+ <li><a href="#method-i-parse_data_hash">#parse_data_hash</a></li>
90
+
91
+ <li><a href="#method-i-response">#response</a></li>
92
+
93
+ <li><a href="#method-i-response_code%3D">#response_code=</a></li>
94
+
95
+ <li><a href="#method-i-successful%3F">#successful?</a></li>
96
+
97
+ <li><a href="#method-i-verify_seal%21">#verify_seal!</a></li>
98
+
99
+ </ul>
100
+ </div>
101
+
102
+
103
+ <!-- Included Modules -->
104
+
105
+ </div>
106
+
107
+ <div id="project-metadata">
108
+
109
+
110
+ <div id="fileindex-section" class="section project-section">
111
+ <h3 class="section-header">Files</h3>
112
+ <ul>
113
+
114
+ <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
115
+
116
+ <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
117
+
118
+ </ul>
119
+ </div>
120
+
121
+
122
+ <div id="classindex-section" class="section project-section">
123
+ <h3 class="section-header">Class Index
124
+ <span class="search-toggle"><img src="../images/find.png"
125
+ height="16" width="16" alt="[+]"
126
+ title="show/hide quicksearch" /></span></h3>
127
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
128
+ <fieldset>
129
+ <legend>Quicksearch</legend>
130
+ <input type="text" name="quicksearch" value=""
131
+ class="quicksearch-field" />
132
+ </fieldset>
133
+ </form>
134
+
135
+ <ul class="link-list">
136
+
137
+ <li><a href="../OmniKassa.html">OmniKassa</a></li>
138
+
139
+ <li><a href="../OmniKassa/ConfigError.html">OmniKassa::ConfigError</a></li>
140
+
141
+ <li><a href="../OmniKassa/OmniKassaError.html">OmniKassa::OmniKassaError</a></li>
142
+
143
+ <li><a href="../OmniKassa/Request.html">OmniKassa::Request</a></li>
144
+
145
+ <li><a href="../OmniKassa/Request/RequestError.html">OmniKassa::Request::RequestError</a></li>
146
+
147
+ <li><a href="../OmniKassa/Response.html">OmniKassa::Response</a></li>
148
+
149
+ <li><a href="../OmniKassa/Response/ResponseCodeError.html">OmniKassa::Response::ResponseCodeError</a></li>
150
+
151
+ <li><a href="../OmniKassa/Response/SealMismatchError.html">OmniKassa::Response::SealMismatchError</a></li>
152
+
153
+ <li><a href="../HelloWorldTest.html">HelloWorldTest</a></li>
154
+
155
+ </ul>
156
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
157
+ </div>
158
+
159
+
160
+ </div>
161
+ </div>
162
+
163
+ <div id="documentation">
164
+ <h1 class="class">OmniKassa::Response</h1>
165
+
166
+ <div id="description">
167
+
168
+ </div>
169
+
170
+ <!-- Constants -->
171
+
172
+ <div id="constants-list" class="section">
173
+ <h3 class="section-header">Constants</h3>
174
+ <dl>
175
+
176
+ <dt><a name="RESPONSE_CODES">RESPONSE_CODES</a></dt>
177
+
178
+ <dd class="description"></dd>
179
+
180
+
181
+ </dl>
182
+ </div>
183
+
184
+
185
+ <!-- Attributes -->
186
+
187
+ <div id="attribute-method-details" class="method-section section">
188
+ <h3 class="section-header">Attributes</h3>
189
+
190
+
191
+ <div id="data-attribute-method" class="method-detail">
192
+ <a name="data"></a>
193
+
194
+ <a name="data="></a>
195
+
196
+ <div class="method-heading attribute-method-heading">
197
+ <span class="method-name">data</span><span
198
+ class="attribute-access-type">[RW]</span>
199
+ </div>
200
+
201
+ <div class="method-description">
202
+
203
+
204
+
205
+ </div>
206
+ </div>
207
+
208
+ <div id="seal-attribute-method" class="method-detail">
209
+ <a name="seal"></a>
210
+
211
+ <a name="seal="></a>
212
+
213
+ <div class="method-heading attribute-method-heading">
214
+ <span class="method-name">seal</span><span
215
+ class="attribute-access-type">[RW]</span>
216
+ </div>
217
+
218
+ <div class="method-description">
219
+
220
+
221
+
222
+ </div>
223
+ </div>
224
+
225
+ <div id="order-id-attribute-method" class="method-detail">
226
+ <a name="order_id"></a>
227
+
228
+ <a name="order_id="></a>
229
+
230
+ <div class="method-heading attribute-method-heading">
231
+ <span class="method-name">order_id</span><span
232
+ class="attribute-access-type">[RW]</span>
233
+ </div>
234
+
235
+ <div class="method-description">
236
+
237
+
238
+
239
+ </div>
240
+ </div>
241
+
242
+ <div id="response-code-attribute-method" class="method-detail">
243
+ <a name="response_code"></a>
244
+
245
+ <a name="response_code="></a>
246
+
247
+ <div class="method-heading attribute-method-heading">
248
+ <span class="method-name">response_code</span><span
249
+ class="attribute-access-type">[RW]</span>
250
+ </div>
251
+
252
+ <div class="method-description">
253
+
254
+
255
+
256
+ </div>
257
+ </div>
258
+
259
+ </div>
260
+
261
+
262
+ <!-- Methods -->
263
+
264
+ <div id="public-class-method-details" class="method-section section">
265
+ <h3 class="section-header">Public Class Methods</h3>
266
+
267
+
268
+ <div id="new-method" class="method-detail ">
269
+ <a name="method-c-new"></a>
270
+
271
+ <div class="method-heading">
272
+
273
+ <span class="method-name">new</span><span
274
+ class="method-args">(params)</span>
275
+ <span class="method-click-advice">click to toggle source</span>
276
+
277
+ </div>
278
+
279
+ <div class="method-description">
280
+
281
+
282
+
283
+
284
+
285
+ <div class="method-source-code"
286
+ id="new-source">
287
+ <pre>
288
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 11</span>
289
+ 11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>)
290
+ 12: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">data</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:Data</span>]
291
+ 13: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">seal</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:Seal</span>]
292
+ 14:
293
+ 15: <span class="ruby-identifier">verify_seal!</span>
294
+ 16: <span class="ruby-keyword kw">end</span></pre>
295
+ </div>
296
+
297
+ </div>
298
+
299
+
300
+
301
+
302
+ </div>
303
+
304
+
305
+ </div>
306
+
307
+ <div id="public-instance-method-details" class="method-section section">
308
+ <h3 class="section-header">Public Instance Methods</h3>
309
+
310
+
311
+ <div id="data--method" class="method-detail ">
312
+ <a name="method-i-data%3D"></a>
313
+
314
+ <div class="method-heading">
315
+
316
+ <span class="method-name">data=</span><span
317
+ class="method-args">(data)</span>
318
+ <span class="method-click-advice">click to toggle source</span>
319
+
320
+ </div>
321
+
322
+ <div class="method-description">
323
+
324
+
325
+
326
+
327
+
328
+ <div class="method-source-code"
329
+ id="data--source">
330
+ <pre>
331
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 26</span>
332
+ 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">data=</span>(<span class="ruby-identifier">data</span>)
333
+ 27: <span class="ruby-ivar">@data</span> = <span class="ruby-identifier">data</span>
334
+ 28: <span class="ruby-identifier">parse_data_hash</span>
335
+ 29: <span class="ruby-keyword kw">end</span></pre>
336
+ </div>
337
+
338
+ </div>
339
+
340
+
341
+
342
+
343
+ </div>
344
+
345
+
346
+ <div id="response-method" class="method-detail ">
347
+ <a name="method-i-response"></a>
348
+
349
+ <div class="method-heading">
350
+
351
+ <span class="method-name">response</span><span
352
+ class="method-args">()</span>
353
+ <span class="method-click-advice">click to toggle source</span>
354
+
355
+ </div>
356
+
357
+ <div class="method-description">
358
+
359
+
360
+
361
+
362
+
363
+ <div class="method-source-code"
364
+ id="response-source">
365
+ <pre>
366
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 22</span>
367
+ 22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">response</span>
368
+ 23: <span class="ruby-constant">RESPONSE_CODES</span>[<span class="ruby-identifier">response_code</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-value">:unknown_failure</span>
369
+ 24: <span class="ruby-keyword kw">end</span></pre>
370
+ </div>
371
+
372
+ </div>
373
+
374
+
375
+
376
+
377
+ </div>
378
+
379
+
380
+ <div id="response-code--method" class="method-detail ">
381
+ <a name="method-i-response_code%3D"></a>
382
+
383
+ <div class="method-heading">
384
+
385
+ <span class="method-name">response_code=</span><span
386
+ class="method-args">(response_code)</span>
387
+ <span class="method-click-advice">click to toggle source</span>
388
+
389
+ </div>
390
+
391
+ <div class="method-description">
392
+
393
+
394
+
395
+
396
+
397
+ <div class="method-source-code"
398
+ id="response-code--source">
399
+ <pre>
400
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 31</span>
401
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">response_code=</span>(<span class="ruby-identifier">response_code</span>)
402
+ 32: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ResponseCodeError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response_code</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/\D/</span>).<span class="ruby-identifier">present?</span>
403
+ 33: <span class="ruby-ivar">@response_code</span> = <span class="ruby-identifier">response_code</span>.<span class="ruby-identifier">to_i</span>
404
+ 34: <span class="ruby-keyword kw">end</span></pre>
405
+ </div>
406
+
407
+ </div>
408
+
409
+
410
+
411
+
412
+ </div>
413
+
414
+
415
+ <div id="successful--method" class="method-detail ">
416
+ <a name="method-i-successful%3F"></a>
417
+
418
+ <div class="method-heading">
419
+
420
+ <span class="method-name">successful?</span><span
421
+ class="method-args">()</span>
422
+ <span class="method-click-advice">click to toggle source</span>
423
+
424
+ </div>
425
+
426
+ <div class="method-description">
427
+
428
+
429
+
430
+
431
+
432
+ <div class="method-source-code"
433
+ id="successful--source">
434
+ <pre>
435
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 18</span>
436
+ 18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successful?</span>
437
+ 19: <span class="ruby-identifier">response</span> <span class="ruby-operator">==</span> <span class="ruby-value">:success</span>
438
+ 20: <span class="ruby-keyword kw">end</span></pre>
439
+ </div>
440
+
441
+ </div>
442
+
443
+
444
+
445
+
446
+ </div>
447
+
448
+
449
+ </div>
450
+
451
+ <div id="protected-instance-method-details" class="method-section section">
452
+ <h3 class="section-header">Protected Instance Methods</h3>
453
+
454
+
455
+ <div id="data-hash-method" class="method-detail ">
456
+ <a name="method-i-data_hash"></a>
457
+
458
+ <div class="method-heading">
459
+
460
+ <span class="method-name">data_hash</span><span
461
+ class="method-args">()</span>
462
+ <span class="method-click-advice">click to toggle source</span>
463
+
464
+ </div>
465
+
466
+ <div class="method-description">
467
+
468
+
469
+
470
+
471
+
472
+ <div class="method-source-code"
473
+ id="data-hash-source">
474
+ <pre>
475
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 49</span>
476
+ 49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">data_hash</span>
477
+ 50: <span class="ruby-constant">Hash</span>[<span class="ruby-identifier">data</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'|'</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'='</span>) }]
478
+ 51: <span class="ruby-keyword kw">end</span></pre>
479
+ </div>
480
+
481
+ </div>
482
+
483
+
484
+
485
+
486
+ </div>
487
+
488
+
489
+ <div id="parse-data-hash-method" class="method-detail ">
490
+ <a name="method-i-parse_data_hash"></a>
491
+
492
+ <div class="method-heading">
493
+
494
+ <span class="method-name">parse_data_hash</span><span
495
+ class="method-args">()</span>
496
+ <span class="method-click-advice">click to toggle source</span>
497
+
498
+ </div>
499
+
500
+ <div class="method-description">
501
+
502
+
503
+
504
+
505
+
506
+ <div class="method-source-code"
507
+ id="parse-data-hash-source">
508
+ <pre>
509
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 42</span>
510
+ 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_data_hash</span>
511
+ 43: <span class="ruby-identifier">data_hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
512
+ 44: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">underscore</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'='</span>
513
+ 45: <span class="ruby-identifier">send</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">key</span>
514
+ 46: <span class="ruby-keyword kw">end</span>
515
+ 47: <span class="ruby-keyword kw">end</span></pre>
516
+ </div>
517
+
518
+ </div>
519
+
520
+
521
+
522
+
523
+ </div>
524
+
525
+
526
+ <div id="verify-seal--method" class="method-detail ">
527
+ <a name="method-i-verify_seal%21"></a>
528
+
529
+ <div class="method-heading">
530
+
531
+ <span class="method-name">verify_seal!</span><span
532
+ class="method-args">()</span>
533
+ <span class="method-click-advice">click to toggle source</span>
534
+
535
+ </div>
536
+
537
+ <div class="method-description">
538
+
539
+
540
+
541
+
542
+
543
+ <div class="method-source-code"
544
+ id="verify-seal--source">
545
+ <pre>
546
+ <span class="ruby-comment cmt"># File lib/omni_kassa/response.rb, line 37</span>
547
+ 37: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_seal!</span>
548
+ 38: <span class="ruby-identifier">seal</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA2</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">data</span> <span class="ruby-operator">+</span> <span class="ruby-constant">OmniKassa</span>.<span class="ruby-identifier">secret_key</span>)
549
+ 39: <span class="ruby-identifier">raise</span> <span class="ruby-constant">SealMismatchError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">seal</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">seal</span>
550
+ 40: <span class="ruby-keyword kw">end</span></pre>
551
+ </div>
552
+
553
+ </div>
554
+
555
+
556
+
557
+
558
+ </div>
559
+
560
+
561
+ </div>
562
+
563
+
564
+ </div>
565
+
566
+
567
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
568
+
569
+ <p>Disabled; run with --debug to generate this.</p>
570
+
571
+ </div>
572
+
573
+ <div id="validator-badges">
574
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
575
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
576
+ Rdoc Generator</a> 1.1.6</small>.</p>
577
+ </div>
578
+
579
+ </body>
580
+ </html>
581
+