zarinpal 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/Guardfile +24 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +1 -0
  9. data/doc/Zarinpal.html +338 -0
  10. data/doc/Zarinpal/Configuration.html +445 -0
  11. data/doc/Zarinpal/Errors.html +149 -0
  12. data/doc/Zarinpal/PaymentRequest.html +805 -0
  13. data/doc/Zarinpal/PaymentVerification.html +540 -0
  14. data/doc/Zarinpal/Response.html +669 -0
  15. data/doc/Zarinpal/Response/ResponseError.html +123 -0
  16. data/doc/_index.html +184 -0
  17. data/doc/class_list.html +54 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +57 -0
  20. data/doc/css/style.css +338 -0
  21. data/doc/doc/_index.html +88 -0
  22. data/doc/doc/class_list.html +54 -0
  23. data/doc/doc/css/common.css +1 -0
  24. data/doc/doc/css/full_list.css +57 -0
  25. data/doc/doc/css/style.css +338 -0
  26. data/doc/doc/file_list.html +53 -0
  27. data/doc/doc/frames.html +26 -0
  28. data/doc/doc/index.html +88 -0
  29. data/doc/doc/js/app.js +214 -0
  30. data/doc/doc/js/full_list.js +178 -0
  31. data/doc/doc/js/jquery.js +4 -0
  32. data/doc/doc/method_list.html +53 -0
  33. data/doc/doc/top-level-namespace.html +102 -0
  34. data/doc/file.README.html +105 -0
  35. data/doc/file_list.html +56 -0
  36. data/doc/frames.html +26 -0
  37. data/doc/index.html +105 -0
  38. data/doc/js/app.js +214 -0
  39. data/doc/js/full_list.js +178 -0
  40. data/doc/js/jquery.js +4 -0
  41. data/doc/method_list.html +191 -0
  42. data/doc/top-level-namespace.html +112 -0
  43. data/lib/zarinpal.rb +37 -0
  44. data/lib/zarinpal/errors.rb +17 -0
  45. data/lib/zarinpal/payment_request.rb +44 -0
  46. data/lib/zarinpal/payment_verification.rb +34 -0
  47. data/lib/zarinpal/response.rb +50 -0
  48. data/lib/zarinpal/version.rb +3 -0
  49. data/spec/lib/configuration_spec.rb +18 -0
  50. data/spec/lib/errors_spec.rb +7 -0
  51. data/spec/lib/payment_request_spec.rb +40 -0
  52. data/spec/lib/payment_verification_spec.rb +41 -0
  53. data/spec/lib/response_spec.rb +46 -0
  54. data/spec/lib/version_spec.rb +7 -0
  55. data/spec/spec_helper.rb +20 -0
  56. data/zarinpal.gemspec +29 -0
  57. metadata +206 -0
@@ -0,0 +1,669 @@
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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Zarinpal::Response
8
+
9
+ &mdash; Documentation by YARD 0.8.7.2
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (R)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Zarinpal.html" title="Zarinpal (module)">Zarinpal</a></span></span>
36
+ &raquo;
37
+ <span class="title">Response</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Zarinpal::Response
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Zarinpal::Response</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/zarinpal/response.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>This classs manages the returned response from PaymentVerification and
106
+ PaymentRequest. If the response is not valid (the status is not code is 100
107
+ or 101) it will raise an error with the corresponding description.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div><h2>Defined Under Namespace</h2>
116
+ <p class="children">
117
+
118
+
119
+
120
+
121
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Response/ResponseError.html" title="Zarinpal::Response::ResponseError (class)">ResponseError</a></span>
122
+
123
+
124
+ </p>
125
+
126
+
127
+
128
+
129
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
130
+ <ul class="summary">
131
+
132
+ <li class="public ">
133
+ <span class="summary_signature">
134
+
135
+ <a href="#authority-instance_method" title="#authority (instance method)">- (Object) <strong>authority</strong> </a>
136
+
137
+
138
+
139
+ </span>
140
+
141
+
142
+
143
+
144
+ <span class="note title readonly">readonly</span>
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <span class="summary_desc"><div class='inline'>
155
+ <p>Returns the value of attribute authority.</p>
156
+ </div></span>
157
+
158
+ </li>
159
+
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#refid-instance_method" title="#refid (instance method)">- (Object) <strong>refid</strong> </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+
172
+
173
+ <span class="note title readonly">readonly</span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ <span class="summary_desc"><div class='inline'>
184
+ <p>Returns the value of attribute refid.</p>
185
+ </div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#response-instance_method" title="#response (instance method)">- (Object) <strong>response</strong> </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+
201
+
202
+ <span class="note title readonly">readonly</span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ <p>Returns the value of attribute response.</p>
214
+ </div></span>
215
+
216
+ </li>
217
+
218
+
219
+ <li class="public ">
220
+ <span class="summary_signature">
221
+
222
+ <a href="#status-instance_method" title="#status (instance method)">- (Object) <strong>status</strong> </a>
223
+
224
+
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+ <span class="note title readonly">readonly</span>
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ <span class="summary_desc"><div class='inline'>
242
+ <p>Returns the value of attribute status.</p>
243
+ </div></span>
244
+
245
+ </li>
246
+
247
+
248
+ </ul>
249
+
250
+
251
+
252
+
253
+
254
+ <h2>
255
+ Instance Method Summary
256
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
257
+ </h2>
258
+
259
+ <ul class="summary">
260
+
261
+ <li class="public ">
262
+ <span class="summary_signature">
263
+
264
+ <a href="#valid%3F-instance_method" title="#valid? (instance method)">- (boolean) <strong>valid?</strong> </a>
265
+
266
+
267
+
268
+ </span>
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+ <span class="summary_desc"><div class='inline'>
279
+ <p>Returns the validation status of response.</p>
280
+ </div></span>
281
+
282
+ </li>
283
+
284
+
285
+ <li class="public ">
286
+ <span class="summary_signature">
287
+
288
+ <a href="#validate-instance_method" title="#validate (instance method)">- (Response) <strong>validate</strong>(response = nil) </a>
289
+
290
+
291
+
292
+ </span>
293
+
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+ <span class="summary_desc"><div class='inline'>
303
+ <p>Checks if the transaction response returned from PaymentRequest or
304
+ PaymentVerification is valid.</p>
305
+ </div></span>
306
+
307
+ </li>
308
+
309
+
310
+ </ul>
311
+
312
+
313
+
314
+ <div id="instance_attr_details" class="attr_details">
315
+ <h2>Instance Attribute Details</h2>
316
+
317
+
318
+ <span id=""></span>
319
+ <div class="method_details first">
320
+ <h3 class="signature first" id="authority-instance_method">
321
+
322
+ - (<tt>Object</tt>) <strong>authority</strong> <span class="extras">(readonly)</span>
323
+
324
+
325
+
326
+
327
+
328
+ </h3><div class="docstring">
329
+ <div class="discussion">
330
+
331
+ <p>Returns the value of attribute authority</p>
332
+
333
+
334
+ </div>
335
+ </div>
336
+ <div class="tags">
337
+
338
+
339
+ </div><table class="source_code">
340
+ <tr>
341
+ <td>
342
+ <pre class="lines">
343
+
344
+
345
+ 9
346
+ 10
347
+ 11</pre>
348
+ </td>
349
+ <td>
350
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/response.rb', line 9</span>
351
+
352
+ <span class='kw'>def</span> <span class='id identifier rubyid_authority'>authority</span>
353
+ <span class='ivar'>@authority</span>
354
+ <span class='kw'>end</span></pre>
355
+ </td>
356
+ </tr>
357
+ </table>
358
+ </div>
359
+
360
+
361
+ <span id=""></span>
362
+ <div class="method_details ">
363
+ <h3 class="signature " id="refid-instance_method">
364
+
365
+ - (<tt>Object</tt>) <strong>refid</strong> <span class="extras">(readonly)</span>
366
+
367
+
368
+
369
+
370
+
371
+ </h3><div class="docstring">
372
+ <div class="discussion">
373
+
374
+ <p>Returns the value of attribute refid</p>
375
+
376
+
377
+ </div>
378
+ </div>
379
+ <div class="tags">
380
+
381
+
382
+ </div><table class="source_code">
383
+ <tr>
384
+ <td>
385
+ <pre class="lines">
386
+
387
+
388
+ 9
389
+ 10
390
+ 11</pre>
391
+ </td>
392
+ <td>
393
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/response.rb', line 9</span>
394
+
395
+ <span class='kw'>def</span> <span class='id identifier rubyid_refid'>refid</span>
396
+ <span class='ivar'>@refid</span>
397
+ <span class='kw'>end</span></pre>
398
+ </td>
399
+ </tr>
400
+ </table>
401
+ </div>
402
+
403
+
404
+ <span id=""></span>
405
+ <div class="method_details ">
406
+ <h3 class="signature " id="response-instance_method">
407
+
408
+ - (<tt>Object</tt>) <strong>response</strong> <span class="extras">(readonly)</span>
409
+
410
+
411
+
412
+
413
+
414
+ </h3><div class="docstring">
415
+ <div class="discussion">
416
+
417
+ <p>Returns the value of attribute response</p>
418
+
419
+
420
+ </div>
421
+ </div>
422
+ <div class="tags">
423
+
424
+
425
+ </div><table class="source_code">
426
+ <tr>
427
+ <td>
428
+ <pre class="lines">
429
+
430
+
431
+ 9
432
+ 10
433
+ 11</pre>
434
+ </td>
435
+ <td>
436
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/response.rb', line 9</span>
437
+
438
+ <span class='kw'>def</span> <span class='id identifier rubyid_response'>response</span>
439
+ <span class='ivar'>@response</span>
440
+ <span class='kw'>end</span></pre>
441
+ </td>
442
+ </tr>
443
+ </table>
444
+ </div>
445
+
446
+
447
+ <span id=""></span>
448
+ <div class="method_details ">
449
+ <h3 class="signature " id="status-instance_method">
450
+
451
+ - (<tt>Object</tt>) <strong>status</strong> <span class="extras">(readonly)</span>
452
+
453
+
454
+
455
+
456
+
457
+ </h3><div class="docstring">
458
+ <div class="discussion">
459
+
460
+ <p>Returns the value of attribute status</p>
461
+
462
+
463
+ </div>
464
+ </div>
465
+ <div class="tags">
466
+
467
+
468
+ </div><table class="source_code">
469
+ <tr>
470
+ <td>
471
+ <pre class="lines">
472
+
473
+
474
+ 9
475
+ 10
476
+ 11</pre>
477
+ </td>
478
+ <td>
479
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/response.rb', line 9</span>
480
+
481
+ <span class='kw'>def</span> <span class='id identifier rubyid_status'>status</span>
482
+ <span class='ivar'>@status</span>
483
+ <span class='kw'>end</span></pre>
484
+ </td>
485
+ </tr>
486
+ </table>
487
+ </div>
488
+
489
+ </div>
490
+
491
+
492
+ <div id="instance_method_details" class="method_details_list">
493
+ <h2>Instance Method Details</h2>
494
+
495
+
496
+ <div class="method_details first">
497
+ <h3 class="signature first" id="valid?-instance_method">
498
+
499
+ - (<tt>boolean</tt>) <strong>valid?</strong>
500
+
501
+
502
+
503
+
504
+
505
+ </h3><div class="docstring">
506
+ <div class="discussion">
507
+
508
+ <p>Returns the validation status of response</p>
509
+
510
+
511
+ </div>
512
+ </div>
513
+ <div class="tags">
514
+
515
+ <p class="tag_title">Returns:</p>
516
+ <ul class="return">
517
+
518
+ <li>
519
+
520
+
521
+ <span class='type'>(<tt>boolean</tt>)</span>
522
+
523
+
524
+
525
+ </li>
526
+
527
+ </ul>
528
+
529
+ </div><table class="source_code">
530
+ <tr>
531
+ <td>
532
+ <pre class="lines">
533
+
534
+
535
+ 28
536
+ 29
537
+ 30</pre>
538
+ </td>
539
+ <td>
540
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/response.rb', line 28</span>
541
+
542
+ <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
543
+ <span class='ivar'>@valid</span>
544
+ <span class='kw'>end</span></pre>
545
+ </td>
546
+ </tr>
547
+ </table>
548
+ </div>
549
+
550
+ <div class="method_details ">
551
+ <h3 class="signature " id="validate-instance_method">
552
+
553
+ - (<tt><span class='object_link'><a href="" title="Zarinpal::Response (class)">Response</a></span></tt>) <strong>validate</strong>(response = nil)
554
+
555
+
556
+
557
+
558
+
559
+ </h3><div class="docstring">
560
+ <div class="discussion">
561
+
562
+ <p>Checks if the transaction response returned from PaymentRequest or
563
+ PaymentVerification is valid</p>
564
+
565
+
566
+ </div>
567
+ </div>
568
+ <div class="tags">
569
+ <p class="tag_title">Parameters:</p>
570
+ <ul class="param">
571
+
572
+ <li>
573
+
574
+ <span class='name'></span>
575
+
576
+
577
+ <span class='type'>(<tt>#response Hash</tt>)</span>
578
+
579
+
580
+
581
+ </li>
582
+
583
+ </ul>
584
+
585
+ <p class="tag_title">Returns:</p>
586
+ <ul class="return">
587
+
588
+ <li>
589
+
590
+
591
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Zarinpal::Response (class)">Response</a></span></tt>)</span>
592
+
593
+
594
+
595
+ </li>
596
+
597
+ </ul>
598
+ <p class="tag_title">Raises:</p>
599
+ <ul class="raise">
600
+
601
+ <li>
602
+
603
+
604
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
605
+
606
+
607
+
608
+ &mdash;
609
+ <div class='inline'>
610
+ <p>if response is nil</p>
611
+ </div>
612
+
613
+ </li>
614
+
615
+ <li>
616
+
617
+
618
+ <span class='type'>(<tt><span class='object_link'><a href="Response/ResponseError.html" title="Zarinpal::Response::ResponseError (class)">ResponseError</a></span></tt>)</span>
619
+
620
+
621
+
622
+ &mdash;
623
+ <div class='inline'>
624
+ <p>if response is not valid</p>
625
+ </div>
626
+
627
+ </li>
628
+
629
+ </ul>
630
+
631
+ </div><table class="source_code">
632
+ <tr>
633
+ <td>
634
+ <pre class="lines">
635
+
636
+
637
+ 18
638
+ 19
639
+ 20
640
+ 21
641
+ 22
642
+ 23</pre>
643
+ </td>
644
+ <td>
645
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/response.rb', line 18</span>
646
+
647
+ <span class='kw'>def</span> <span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
648
+ <span class='ivar'>@response</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span>
649
+ <span class='id identifier rubyid_perform_validation'>perform_validation</span>
650
+
651
+ <span class='kw'>return</span> <span class='kw'>self</span>
652
+ <span class='kw'>end</span></pre>
653
+ </td>
654
+ </tr>
655
+ </table>
656
+ </div>
657
+
658
+ </div>
659
+
660
+ </div>
661
+
662
+ <div id="footer">
663
+ Generated on Sat Mar 1 21:03:59 2014 by
664
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
665
+ 0.8.7.2 (ruby-2.1.0).
666
+ </div>
667
+
668
+ </body>
669
+ </html>