t2_airtime 0.2.0 → 0.2.1

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,338 @@
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: T2Airtime::Util
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 = "T2Airtime::Util";
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 (U)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span>
41
+ &raquo;
42
+ <span class="title">Util</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: T2Airtime::Util
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">T2Airtime::Util</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/t2_airtime/util.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>
111
+ Class Method Summary
112
+ <small><a href="#" class="summary_toggle">collapse</a></small>
113
+ </h2>
114
+
115
+ <ul class="summary">
116
+
117
+ <li class="public ">
118
+ <span class="summary_signature">
119
+
120
+ <a href="#format_price-class_method" title="format_price (class method)">.<strong>format_price</strong>(price, currency = (ENV[&#39;T2_CURRENCY&#39;] || &quot;USD&quot;)) &#x21d2; Object </a>
121
+
122
+
123
+
124
+ </span>
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'></div></span>
135
+
136
+ </li>
137
+
138
+
139
+ <li class="public ">
140
+ <span class="summary_signature">
141
+
142
+ <a href="#operator_logo_url-class_method" title="operator_logo_url (class method)">.<strong>operator_logo_url</strong>(operator_aid, size = 1) &#x21d2; Object </a>
143
+
144
+
145
+
146
+ </span>
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ <span class="summary_desc"><div class='inline'>
157
+ <p>Operator Logo URL.</p>
158
+ </div></span>
159
+
160
+ </li>
161
+
162
+
163
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#test_numbers-class_method" title="test_numbers (class method)">.<strong>test_numbers</strong>(num = 0) &#x21d2; Object </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'>
181
+ <p>A few fake phone numbers in Indonesia have been created and set up with
182
+ available products of IDR 5000, 10000, 20000, 50000 and 100000:
183
+ 628123456710: error code 0 for PIN based Top-up (successful transaction).</p>
184
+ </div></span>
185
+
186
+ </li>
187
+
188
+
189
+ </ul>
190
+
191
+
192
+
193
+
194
+ <div id="class_method_details" class="method_details_list">
195
+ <h2>Class Method Details</h2>
196
+
197
+
198
+ <div class="method_details first">
199
+ <h3 class="signature first" id="format_price-class_method">
200
+
201
+ .<strong>format_price</strong>(price, currency = (ENV[&#39;T2_CURRENCY&#39;] || &quot;USD&quot;)) &#x21d2; <tt>Object</tt>
202
+
203
+
204
+
205
+
206
+
207
+ </h3><table class="source_code">
208
+ <tr>
209
+ <td>
210
+ <pre class="lines">
211
+
212
+
213
+ 20
214
+ 21
215
+ 22</pre>
216
+ </td>
217
+ <td>
218
+ <pre class="code"><span class="info file"># File 'lib/t2_airtime/util.rb', line 20</span>
219
+
220
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_format_price'>format_price</span><span class='lparen'>(</span><span class='id identifier rubyid_price'>price</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='op'>=</span><span class='lparen'>(</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>T2_CURRENCY</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>USD</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
221
+ <span class='const'>Money</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Float</span><span class='lparen'>(</span><span class='id identifier rubyid_price'>price</span><span class='rparen'>)</span><span class='op'>*</span><span class='int'>100</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span>
222
+ <span class='kw'>end</span></pre>
223
+ </td>
224
+ </tr>
225
+ </table>
226
+ </div>
227
+
228
+ <div class="method_details ">
229
+ <h3 class="signature " id="operator_logo_url-class_method">
230
+
231
+ .<strong>operator_logo_url</strong>(operator_aid, size = 1) &#x21d2; <tt>Object</tt>
232
+
233
+
234
+
235
+
236
+
237
+ </h3><div class="docstring">
238
+ <div class="discussion">
239
+
240
+ <p>Operator Logo URL</p>
241
+
242
+
243
+ </div>
244
+ </div>
245
+ <div class="tags">
246
+
247
+
248
+ </div><table class="source_code">
249
+ <tr>
250
+ <td>
251
+ <pre class="lines">
252
+
253
+
254
+ 25
255
+ 26
256
+ 27</pre>
257
+ </td>
258
+ <td>
259
+ <pre class="code"><span class="info file"># File 'lib/t2_airtime/util.rb', line 25</span>
260
+
261
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_operator_logo_url'>operator_logo_url</span><span class='lparen'>(</span><span class='id identifier rubyid_operator_aid'>operator_aid</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span>
262
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>https://</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../T2Airtime.html#OPLOGO_DN-constant" title="T2Airtime::OPLOGO_DN (constant)">OPLOGO_DN</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../T2Airtime.html" title="T2Airtime (module)">T2Airtime</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../T2Airtime.html#DOMAIN-constant" title="T2Airtime::DOMAIN (constant)">DOMAIN</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/logo-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_operator_aid'>operator_aid</span><span class='embexpr_end'>}</span><span class='tstring_content'>-</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'>.png</span><span class='tstring_end'>&quot;</span></span>
263
+ <span class='kw'>end</span></pre>
264
+ </td>
265
+ </tr>
266
+ </table>
267
+ </div>
268
+
269
+ <div class="method_details ">
270
+ <h3 class="signature " id="test_numbers-class_method">
271
+
272
+ .<strong>test_numbers</strong>(num = 0) &#x21d2; <tt>Object</tt>
273
+
274
+
275
+
276
+
277
+
278
+ </h3><div class="docstring">
279
+ <div class="discussion">
280
+
281
+ <p>A few fake phone numbers in Indonesia have been created and set up with
282
+ available products of IDR 5000, 10000, 20000, 50000 and 100000:</p>
283
+
284
+ <p>628123456710: error code 0 for PIN based Top-up (successful transaction).
285
+ 628123456770: error code 0 for PIN less Top-up (successful transaction).
286
+ 628123456780: error code 204 (destination number is not a valid prepaid
287
+ phone number). 628123456781: error code 301 (input value out of range or
288
+ invalid product). 628123456790: error code 214 (transaction refused by the
289
+ operator). 628123456798: error code 998 (system not available, please retry
290
+ later). 628123456799: error code 999 (unknown error, please contact
291
+ support).</p>
292
+
293
+
294
+ </div>
295
+ </div>
296
+ <div class="tags">
297
+
298
+
299
+ </div><table class="source_code">
300
+ <tr>
301
+ <td>
302
+ <pre class="lines">
303
+
304
+
305
+ 13
306
+ 14
307
+ 15
308
+ 16
309
+ 17
310
+ 18</pre>
311
+ </td>
312
+ <td>
313
+ <pre class="code"><span class="info file"># File 'lib/t2_airtime/util.rb', line 13</span>
314
+
315
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_test_numbers'>test_numbers</span><span class='lparen'>(</span><span class='id identifier rubyid_num'>num</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
316
+ <span class='id identifier rubyid_numbers'>numbers</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456710</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456770</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456780</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
317
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456781</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456790</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456798</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
318
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>628123456799</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span>
319
+ <span class='id identifier rubyid_num'>num</span> <span class='op'>&gt;</span> <span class='int'>0</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_num'>num</span> <span class='op'>&lt;</span> <span class='int'>8</span> <span class='op'>?</span> <span class='id identifier rubyid_numbers'>numbers</span><span class='lbracket'>[</span><span class='id identifier rubyid_num'>num</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='id identifier rubyid_numbers'>numbers</span>
320
+ <span class='kw'>end</span></pre>
321
+ </td>
322
+ </tr>
323
+ </table>
324
+ </div>
325
+
326
+ </div>
327
+
328
+ </div>
329
+
330
+ <div id="footer">
331
+ Generated on Sun Aug 27 17:54:43 2017 by
332
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
333
+ 0.9.9 (ruby-2.3.3).
334
+ </div>
335
+
336
+ </div>
337
+ </body>
338
+ </html>
@@ -0,0 +1,147 @@
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: T2Airtime
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 = "T2Airtime";
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 (T)</a> &raquo;
40
+
41
+
42
+ <span class="title">T2Airtime</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: T2Airtime
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/t2_airtime.rb<span class="defines">,<br />
82
+ lib/t2_airtime/api.rb,<br /> lib/t2_airtime/url.rb,<br /> lib/t2_airtime/base.rb,<br /> lib/t2_airtime/util.rb,<br /> lib/t2_airtime/reply.rb,<br /> lib/t2_airtime/engine.rb,<br /> lib/t2_airtime/errors.rb,<br /> lib/t2_airtime/request.rb,<br /> lib/t2_airtime/version.rb,<br /> lib/t2_airtime/serializer.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Defined Under Namespace</h2>
89
+ <p class="children">
90
+
91
+
92
+
93
+
94
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="T2Airtime/API.html" title="T2Airtime::API (class)">API</a></span>, <span class='object_link'><a href="T2Airtime/Account.html" title="T2Airtime::Account (class)">Account</a></span>, <span class='object_link'><a href="T2Airtime/Base.html" title="T2Airtime::Base (class)">Base</a></span>, <span class='object_link'><a href="T2Airtime/ConfigurationError.html" title="T2Airtime::ConfigurationError (class)">ConfigurationError</a></span>, <span class='object_link'><a href="T2Airtime/Country.html" title="T2Airtime::Country (class)">Country</a></span>, <span class='object_link'><a href="T2Airtime/Engine.html" title="T2Airtime::Engine (class)">Engine</a></span>, <span class='object_link'><a href="T2Airtime/Error.html" title="T2Airtime::Error (class)">Error</a></span>, <span class='object_link'><a href="T2Airtime/Operator.html" title="T2Airtime::Operator (class)">Operator</a></span>, <span class='object_link'><a href="T2Airtime/Product.html" title="T2Airtime::Product (class)">Product</a></span>, <span class='object_link'><a href="T2Airtime/Reply.html" title="T2Airtime::Reply (class)">Reply</a></span>, <span class='object_link'><a href="T2Airtime/Request.html" title="T2Airtime::Request (class)">Request</a></span>, <span class='object_link'><a href="T2Airtime/Transaction.html" title="T2Airtime::Transaction (class)">Transaction</a></span>, <span class='object_link'><a href="T2Airtime/Util.html" title="T2Airtime::Util (class)">Util</a></span>
95
+
96
+
97
+ </p>
98
+
99
+ <h2>Constant Summary</h2>
100
+ <dl class="constants">
101
+
102
+ <dt id="DOMAIN-constant" class="">DOMAIN =
103
+
104
+ </dt>
105
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>transferto.com</span><span class='tstring_end'>&quot;</span></span></pre></dd>
106
+
107
+ <dt id="AIRTIME_DN-constant" class="">AIRTIME_DN =
108
+
109
+ </dt>
110
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>airtime</span><span class='tstring_end'>&quot;</span></span></pre></dd>
111
+
112
+ <dt id="OPLOGO_DN-constant" class="">OPLOGO_DN =
113
+
114
+ </dt>
115
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>operator-logo</span><span class='tstring_end'>&quot;</span></span></pre></dd>
116
+
117
+ <dt id="ENDPOINT-constant" class="">ENDPOINT =
118
+
119
+ </dt>
120
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>cgi-bin/shop/topup</span><span class='tstring_end'>&quot;</span></span></pre></dd>
121
+
122
+ <dt id="VERSION-constant" class="">VERSION =
123
+
124
+ </dt>
125
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.2.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
126
+
127
+ </dl>
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ </div>
138
+
139
+ <div id="footer">
140
+ Generated on Sun Aug 27 17:54:43 2017 by
141
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
142
+ 0.9.9 (ruby-2.3.3).
143
+ </div>
144
+
145
+ </div>
146
+ </body>
147
+ </html>