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,445 @@
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::Configuration
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 (C)</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">Configuration</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::Configuration
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::Configuration</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.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>Configures the gem</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+ <div class="examples">
113
+ <p class="tag_title">Examples:</p>
114
+
115
+
116
+ <pre class="example code"><code><span class='const'>Zarinpal</span><span class='period'>.</span><span class='id identifier rubyid_configure'>configure</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config'>config</span><span class='op'>|</span>
117
+ <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_merchant_id'>merchant_id</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</span><span class='tstring_end'>&#39;</span></span>
118
+ <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_callback_url'>callback_url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>http://example.com/call_back</span><span class='tstring_end'>&#39;</span></span>
119
+ <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://de.zarinpal.com/pg/services/WebGate/wsdl</span><span class='tstring_end'>&#39;</span></span>
120
+ <span class='kw'>end</span></code></pre>
121
+
122
+ </div>
123
+
124
+
125
+ </div>
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="#callback_url-instance_method" title="#callback_url (instance method)">- (Object) <strong>callback_url</strong> </a>
136
+
137
+
138
+
139
+ </span>
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'>
153
+ <p>Returns the value of attribute callback_url.</p>
154
+ </div></span>
155
+
156
+ </li>
157
+
158
+
159
+ <li class="public ">
160
+ <span class="summary_signature">
161
+
162
+ <a href="#client-instance_method" title="#client (instance method)">- (Object) <strong>client</strong> </a>
163
+
164
+
165
+
166
+ </span>
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ <span class="summary_desc"><div class='inline'>
180
+ <p>Returns the value of attribute client.</p>
181
+ </div></span>
182
+
183
+ </li>
184
+
185
+
186
+ <li class="public ">
187
+ <span class="summary_signature">
188
+
189
+ <a href="#merchant_id-instance_method" title="#merchant_id (instance method)">- (Object) <strong>merchant_id</strong> </a>
190
+
191
+
192
+
193
+ </span>
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <span class="summary_desc"><div class='inline'>
207
+ <p>Returns the value of attribute merchant_id.</p>
208
+ </div></span>
209
+
210
+ </li>
211
+
212
+
213
+ </ul>
214
+
215
+
216
+
217
+
218
+
219
+ <h2>
220
+ Instance Method Summary
221
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
222
+ </h2>
223
+
224
+ <ul class="summary">
225
+
226
+ <li class="public ">
227
+ <span class="summary_signature">
228
+
229
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Configuration) <strong>initialize</strong> </a>
230
+
231
+
232
+
233
+ </span>
234
+
235
+
236
+ <span class="note title constructor">constructor</span>
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+ <span class="summary_desc"><div class='inline'>
246
+ <p>A new instance of Configuration.</p>
247
+ </div></span>
248
+
249
+ </li>
250
+
251
+
252
+ </ul>
253
+
254
+
255
+ <div id="constructor_details" class="method_details_list">
256
+ <h2>Constructor Details</h2>
257
+
258
+ <div class="method_details first">
259
+ <h3 class="signature first" id="initialize-instance_method">
260
+
261
+ - (<tt><span class='object_link'><a href="" title="Zarinpal::Configuration (class)">Configuration</a></span></tt>) <strong>initialize</strong>
262
+
263
+
264
+
265
+
266
+
267
+ </h3><div class="docstring">
268
+ <div class="discussion">
269
+
270
+ <p>Returns a new instance of Configuration</p>
271
+
272
+
273
+ </div>
274
+ </div>
275
+ <div class="tags">
276
+
277
+
278
+ </div><table class="source_code">
279
+ <tr>
280
+ <td>
281
+ <pre class="lines">
282
+
283
+
284
+ 32
285
+ 33
286
+ 34</pre>
287
+ </td>
288
+ <td>
289
+ <pre class="code"><span class="info file"># File 'lib/zarinpal.rb', line 32</span>
290
+
291
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
292
+ <span class='ivar'>@client</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://de.zarinpal.com/pg/services/WebGate/wsdl</span><span class='tstring_end'>&#39;</span></span>
293
+ <span class='kw'>end</span></pre>
294
+ </td>
295
+ </tr>
296
+ </table>
297
+ </div>
298
+
299
+ </div>
300
+
301
+ <div id="instance_attr_details" class="attr_details">
302
+ <h2>Instance Attribute Details</h2>
303
+
304
+
305
+ <span id="callback_url=-instance_method"></span>
306
+ <div class="method_details first">
307
+ <h3 class="signature first" id="callback_url-instance_method">
308
+
309
+ - (<tt>Object</tt>) <strong>callback_url</strong>
310
+
311
+
312
+
313
+
314
+
315
+ </h3><div class="docstring">
316
+ <div class="discussion">
317
+
318
+ <p>Returns the value of attribute callback_url</p>
319
+
320
+
321
+ </div>
322
+ </div>
323
+ <div class="tags">
324
+
325
+
326
+ </div><table class="source_code">
327
+ <tr>
328
+ <td>
329
+ <pre class="lines">
330
+
331
+
332
+ 30
333
+ 31
334
+ 32</pre>
335
+ </td>
336
+ <td>
337
+ <pre class="code"><span class="info file"># File 'lib/zarinpal.rb', line 30</span>
338
+
339
+ <span class='kw'>def</span> <span class='id identifier rubyid_callback_url'>callback_url</span>
340
+ <span class='ivar'>@callback_url</span>
341
+ <span class='kw'>end</span></pre>
342
+ </td>
343
+ </tr>
344
+ </table>
345
+ </div>
346
+
347
+
348
+ <span id="client=-instance_method"></span>
349
+ <div class="method_details ">
350
+ <h3 class="signature " id="client-instance_method">
351
+
352
+ - (<tt>Object</tt>) <strong>client</strong>
353
+
354
+
355
+
356
+
357
+
358
+ </h3><div class="docstring">
359
+ <div class="discussion">
360
+
361
+ <p>Returns the value of attribute client</p>
362
+
363
+
364
+ </div>
365
+ </div>
366
+ <div class="tags">
367
+
368
+
369
+ </div><table class="source_code">
370
+ <tr>
371
+ <td>
372
+ <pre class="lines">
373
+
374
+
375
+ 30
376
+ 31
377
+ 32</pre>
378
+ </td>
379
+ <td>
380
+ <pre class="code"><span class="info file"># File 'lib/zarinpal.rb', line 30</span>
381
+
382
+ <span class='kw'>def</span> <span class='id identifier rubyid_client'>client</span>
383
+ <span class='ivar'>@client</span>
384
+ <span class='kw'>end</span></pre>
385
+ </td>
386
+ </tr>
387
+ </table>
388
+ </div>
389
+
390
+
391
+ <span id="merchant_id=-instance_method"></span>
392
+ <div class="method_details ">
393
+ <h3 class="signature " id="merchant_id-instance_method">
394
+
395
+ - (<tt>Object</tt>) <strong>merchant_id</strong>
396
+
397
+
398
+
399
+
400
+
401
+ </h3><div class="docstring">
402
+ <div class="discussion">
403
+
404
+ <p>Returns the value of attribute merchant_id</p>
405
+
406
+
407
+ </div>
408
+ </div>
409
+ <div class="tags">
410
+
411
+
412
+ </div><table class="source_code">
413
+ <tr>
414
+ <td>
415
+ <pre class="lines">
416
+
417
+
418
+ 30
419
+ 31
420
+ 32</pre>
421
+ </td>
422
+ <td>
423
+ <pre class="code"><span class="info file"># File 'lib/zarinpal.rb', line 30</span>
424
+
425
+ <span class='kw'>def</span> <span class='id identifier rubyid_merchant_id'>merchant_id</span>
426
+ <span class='ivar'>@merchant_id</span>
427
+ <span class='kw'>end</span></pre>
428
+ </td>
429
+ </tr>
430
+ </table>
431
+ </div>
432
+
433
+ </div>
434
+
435
+
436
+ </div>
437
+
438
+ <div id="footer">
439
+ Generated on Sat Mar 1 21:03:59 2014 by
440
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
441
+ 0.8.7.2 (ruby-2.1.0).
442
+ </div>
443
+
444
+ </body>
445
+ </html>
@@ -0,0 +1,149 @@
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
+ Module: Zarinpal::Errors
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 (E)</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">Errors</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>Module: Zarinpal::Errors
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/zarinpal/errors.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+
90
+ <p>List of status code errors and description</p>
91
+
92
+
93
+ </div>
94
+ </div>
95
+ <div class="tags">
96
+
97
+
98
+ </div>
99
+ <h2>Constant Summary</h2>
100
+
101
+ <dl class="constants">
102
+
103
+ <dt id="IDS-constant" class="">IDS =
104
+ <div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>List of status code errors and description</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+ </dt>
117
+ <dd><pre class="code"><span class='lbrace'>{</span>
118
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-1</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Insufficient information</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
119
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-2</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>IP or Merchant Code is not correct</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
120
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-3</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Amount should be greater than 1000</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
121
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-4</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Insufficient</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
122
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-11</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Requested response didn\&#39;t find</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
123
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-21</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>No financial action found for this transaction</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
124
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-22</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Unsuccessful transaction</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
125
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-33</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Transaction price is not equal to payed amount</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
126
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-54</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>The request had archived</span><span class='tstring_end'>&#39;</span></span>
127
+ <span class='rbrace'>}</span></pre></dd>
128
+
129
+ </dl>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ </div>
141
+
142
+ <div id="footer">
143
+ Generated on Sat Mar 1 21:03:59 2014 by
144
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
145
+ 0.8.7.2 (ruby-2.1.0).
146
+ </div>
147
+
148
+ </body>
149
+ </html>