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,540 @@
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::PaymentVerification
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 (P)</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">PaymentVerification</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::PaymentVerification
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::PaymentVerification</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/payment_verification.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>Verifyes transaction with Zarinpal</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#refid-instance_method" title="#refid (instance method)">- (Object) <strong>refid</strong> </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+ <span class="note title readonly">readonly</span>
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'>
143
+ <p>Returns the value of attribute refid.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#status-instance_method" title="#status (instance method)">- (Object) <strong>status</strong> </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+ <span class="note title readonly">readonly</span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>Returns the value of attribute status.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ </ul>
179
+
180
+
181
+
182
+
183
+
184
+ <h2>
185
+ Instance Method Summary
186
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
187
+ </h2>
188
+
189
+ <ul class="summary">
190
+
191
+ <li class="public ">
192
+ <span class="summary_signature">
193
+
194
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (PaymentVerification) <strong>initialize</strong>(args = {}) </a>
195
+
196
+
197
+
198
+ </span>
199
+
200
+
201
+ <span class="note title constructor">constructor</span>
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="summary_desc"><div class='inline'>
211
+ <p>A new instance of PaymentVerification.</p>
212
+ </div></span>
213
+
214
+ </li>
215
+
216
+
217
+ <li class="public ">
218
+ <span class="summary_signature">
219
+
220
+ <a href="#verify-instance_method" title="#verify (instance method)">- (Zarinpal::Response) <strong>verify</strong> </a>
221
+
222
+
223
+
224
+ </span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="summary_desc"><div class='inline'>
235
+ <p>Send verification request to Zarinpal.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ </ul>
242
+
243
+
244
+ <div id="constructor_details" class="method_details_list">
245
+ <h2>Constructor Details</h2>
246
+
247
+ <div class="method_details first">
248
+ <h3 class="signature first" id="initialize-instance_method">
249
+
250
+ - (<tt><span class='object_link'><a href="" title="Zarinpal::PaymentVerification (class)">PaymentVerification</a></span></tt>) <strong>initialize</strong>(args = {})
251
+
252
+
253
+
254
+
255
+
256
+ </h3><div class="docstring">
257
+ <div class="discussion">
258
+
259
+ <div class="note notetag">
260
+ <strong>Note:</strong>
261
+ <div class='inline'>
262
+ <p>A hash of parameters should be send to this class</p>
263
+ </div>
264
+ </div>
265
+
266
+
267
+ <p>Returns a new instance of PaymentVerification</p>
268
+
269
+
270
+ </div>
271
+ </div>
272
+ <div class="tags">
273
+
274
+ <div class="examples">
275
+ <p class="tag_title">Examples:</p>
276
+
277
+
278
+ <pre class="example code"><code><span class='const'>PaymentVerification</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>authority:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>xxx-xxx</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>amount:</span> <span class='int'>10000</span><span class='rparen'>)</span></code></pre>
279
+
280
+ </div>
281
+ <p class="tag_title">Parameters:</p>
282
+ <ul class="param">
283
+
284
+ <li>
285
+
286
+ <span class='name'>args</span>
287
+
288
+
289
+ <span class='type'>(<tt>Hash</tt>)</span>
290
+
291
+
292
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
293
+
294
+
295
+ &mdash;
296
+ <div class='inline'>
297
+ <p>hash of params to verify transaction</p>
298
+ </div>
299
+
300
+ </li>
301
+
302
+ </ul>
303
+
304
+
305
+
306
+
307
+ <p class="tag_title">Options Hash (<tt>args</tt>):</p>
308
+ <ul class="option">
309
+
310
+ <li>
311
+ <span class="name">:authority</span>
312
+ <span class="type">(<tt>String</tt>)</span>
313
+ <span class="default">
314
+
315
+ </span>
316
+
317
+ &mdash; <div class='inline'>
318
+ <p>Authority code returned from PaymentRequest</p>
319
+ </div>
320
+
321
+ </li>
322
+
323
+ <li>
324
+ <span class="name">:amount</span>
325
+ <span class="type">(<tt>Integer</tt>)</span>
326
+ <span class="default">
327
+
328
+ </span>
329
+
330
+ &mdash; <div class='inline'>
331
+ <p>price of the request</p>
332
+ </div>
333
+
334
+ </li>
335
+
336
+ </ul>
337
+
338
+
339
+
340
+ </div><table class="source_code">
341
+ <tr>
342
+ <td>
343
+ <pre class="lines">
344
+
345
+
346
+ 15
347
+ 16
348
+ 17
349
+ 18
350
+ 19
351
+ 20</pre>
352
+ </td>
353
+ <td>
354
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/payment_verification.rb', line 15</span>
355
+
356
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
357
+ <span class='ivar'>@authority</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:authority</span><span class='rparen'>)</span>
358
+ <span class='ivar'>@amount</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:amount</span><span class='rparen'>)</span>
359
+ <span class='ivar'>@client</span> <span class='op'>=</span> <span class='const'>Savon</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='lparen'>(</span><span class='label'>wsdl:</span> <span class='const'>Zarinpal</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span><span class='comma'>,</span> <span class='label'>pretty_print_xml:</span> <span class='kw'>true</span><span class='rparen'>)</span>
360
+ <span class='ivar'>@response</span> <span class='op'>=</span> <span class='const'>Response</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
361
+ <span class='kw'>end</span></pre>
362
+ </td>
363
+ </tr>
364
+ </table>
365
+ </div>
366
+
367
+ </div>
368
+
369
+ <div id="instance_attr_details" class="attr_details">
370
+ <h2>Instance Attribute Details</h2>
371
+
372
+
373
+ <span id=""></span>
374
+ <div class="method_details first">
375
+ <h3 class="signature first" id="refid-instance_method">
376
+
377
+ - (<tt>Object</tt>) <strong>refid</strong> <span class="extras">(readonly)</span>
378
+
379
+
380
+
381
+
382
+
383
+ </h3><div class="docstring">
384
+ <div class="discussion">
385
+
386
+ <p>Returns the value of attribute refid</p>
387
+
388
+
389
+ </div>
390
+ </div>
391
+ <div class="tags">
392
+
393
+
394
+ </div><table class="source_code">
395
+ <tr>
396
+ <td>
397
+ <pre class="lines">
398
+
399
+
400
+ 6
401
+ 7
402
+ 8</pre>
403
+ </td>
404
+ <td>
405
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/payment_verification.rb', line 6</span>
406
+
407
+ <span class='kw'>def</span> <span class='id identifier rubyid_refid'>refid</span>
408
+ <span class='ivar'>@refid</span>
409
+ <span class='kw'>end</span></pre>
410
+ </td>
411
+ </tr>
412
+ </table>
413
+ </div>
414
+
415
+
416
+ <span id=""></span>
417
+ <div class="method_details ">
418
+ <h3 class="signature " id="status-instance_method">
419
+
420
+ - (<tt>Object</tt>) <strong>status</strong> <span class="extras">(readonly)</span>
421
+
422
+
423
+
424
+
425
+
426
+ </h3><div class="docstring">
427
+ <div class="discussion">
428
+
429
+ <p>Returns the value of attribute status</p>
430
+
431
+
432
+ </div>
433
+ </div>
434
+ <div class="tags">
435
+
436
+
437
+ </div><table class="source_code">
438
+ <tr>
439
+ <td>
440
+ <pre class="lines">
441
+
442
+
443
+ 6
444
+ 7
445
+ 8</pre>
446
+ </td>
447
+ <td>
448
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/payment_verification.rb', line 6</span>
449
+
450
+ <span class='kw'>def</span> <span class='id identifier rubyid_status'>status</span>
451
+ <span class='ivar'>@status</span>
452
+ <span class='kw'>end</span></pre>
453
+ </td>
454
+ </tr>
455
+ </table>
456
+ </div>
457
+
458
+ </div>
459
+
460
+
461
+ <div id="instance_method_details" class="method_details_list">
462
+ <h2>Instance Method Details</h2>
463
+
464
+
465
+ <div class="method_details first">
466
+ <h3 class="signature first" id="verify-instance_method">
467
+
468
+ - (<tt><span class='object_link'><a href="Response.html" title="Zarinpal::Response (class)">Zarinpal::Response</a></span></tt>) <strong>verify</strong>
469
+
470
+
471
+
472
+
473
+
474
+ </h3><div class="docstring">
475
+ <div class="discussion">
476
+
477
+ <p>Send verification request to Zarinpal</p>
478
+
479
+
480
+ </div>
481
+ </div>
482
+ <div class="tags">
483
+
484
+ <p class="tag_title">Returns:</p>
485
+ <ul class="return">
486
+
487
+ <li>
488
+
489
+
490
+ <span class='type'>(<tt><span class='object_link'><a href="Response.html" title="Zarinpal::Response (class)">Zarinpal::Response</a></span></tt>)</span>
491
+
492
+
493
+
494
+ </li>
495
+
496
+ </ul>
497
+
498
+ </div><table class="source_code">
499
+ <tr>
500
+ <td>
501
+ <pre class="lines">
502
+
503
+
504
+ 25
505
+ 26
506
+ 27
507
+ 28
508
+ 29
509
+ 30
510
+ 31
511
+ 32</pre>
512
+ </td>
513
+ <td>
514
+ <pre class="code"><span class="info file"># File 'lib/zarinpal/payment_verification.rb', line 25</span>
515
+
516
+ <span class='kw'>def</span> <span class='id identifier rubyid_verify'>verify</span>
517
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@client</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='symbol'>:payment_verification</span><span class='comma'>,</span> <span class='label'>message:</span> <span class='lbrace'>{</span>
518
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>MerchantID</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>Zarinpal</span><span class='period'>.</span><span class='id identifier rubyid_configuration'>configuration</span><span class='period'>.</span><span class='id identifier rubyid_merchant_id'>merchant_id</span><span class='comma'>,</span>
519
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Authority</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='ivar'>@authority</span><span class='comma'>,</span>
520
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Amount</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='ivar'>@amount</span>
521
+ <span class='rbrace'>}</span>
522
+ <span class='ivar'>@response</span><span class='period'>.</span><span class='id identifier rubyid_validate'>validate</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
523
+ <span class='kw'>end</span></pre>
524
+ </td>
525
+ </tr>
526
+ </table>
527
+ </div>
528
+
529
+ </div>
530
+
531
+ </div>
532
+
533
+ <div id="footer">
534
+ Generated on Sat Mar 1 21:03:59 2014 by
535
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
536
+ 0.8.7.2 (ruby-2.1.0).
537
+ </div>
538
+
539
+ </body>
540
+ </html>