t2_airtime 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/README.md +13 -14
- data/app/controllers/t2_airtime/airtime_controller.rb +9 -4
- data/doc/T2Airtime/API.html +1152 -0
- data/doc/T2Airtime/Account.html +260 -0
- data/doc/T2Airtime/AirtimeController.html +491 -0
- data/doc/T2Airtime/Base.html +346 -0
- data/doc/T2Airtime/ConfigurationError.html +124 -0
- data/doc/T2Airtime/Country.html +448 -0
- data/doc/T2Airtime/Engine.html +124 -0
- data/doc/T2Airtime/Error.html +290 -0
- data/doc/T2Airtime/Operator.html +272 -0
- data/doc/T2Airtime/Product.html +294 -0
- data/doc/T2Airtime/Reply.html +775 -0
- data/doc/T2Airtime/Request.html +664 -0
- data/doc/T2Airtime/Test.html +221 -0
- data/doc/T2Airtime/Transaction.html +426 -0
- data/doc/T2Airtime/Util.html +338 -0
- data/doc/T2Airtime.html +147 -0
- data/doc/_index.html +265 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +492 -0
- data/doc/file.README.html +172 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +172 -0
- data/doc/js/app.js +248 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +491 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/t2_airtime/serializer.rb +10 -5
- data/lib/t2_airtime/util.rb +4 -0
- data/lib/t2_airtime/version.rb +1 -1
- data/release +6 -0
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 380883694d9e2012b6a23f88879f44a05005efad
|
4
|
+
data.tar.gz: 3ed077121a1271feb7f0966d3d519315277c072d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb27cede9bea986e496a2e0dcd05a3f46fff44bf33b3e020e20f723a44c6d53c9fe7c7038d9c1974ba6ffe3936b5079897a6a42447e9f1948d080152b1ded2b
|
7
|
+
data.tar.gz: a08ded72071d2d07c2dd85960051602ba70fb67f5c480b43b9e9372ffe27343778a6f3cea7249d341251071accbd2018aa3afc745c4e5daf533d1754a4afd7ac
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -3,24 +3,23 @@
|
|
3
3
|
[TransferTo](https://www.transfer-to.com/home) helps businesses offer airtime top-ups, goods and services, and mobile money around the world in real time.
|
4
4
|
TransferTo Airtime API enables developers to integrate TransferTo Top-up service into their system.
|
5
5
|
|
6
|
-
This gem is a convenience wrapper around the Airtime API.
|
7
|
-
|
8
|
-
Two Factor Authentication (2FA) enabled in your [TransferTo Shop](https://shop.transferto.com) Security Center section.
|
6
|
+
This gem is a convenience wrapper around the Airtime API. Requirement is that Two Factor Authentication (2FA) is enabled in your [TransferTo Shop](https://shop.transferto.com) Security Center section.
|
9
7
|
|
10
8
|
|
11
9
|
## Usage
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
11
|
+
Create a new rails application (the flags used here are just for simplicity):
|
12
|
+
|
13
|
+
rails new airtime \
|
14
|
+
--skip-active-record \
|
15
|
+
--skip-yarn \
|
16
|
+
--skip-action-cable \
|
17
|
+
--skip-sprockets \
|
18
|
+
--skip-spring \
|
19
|
+
--skip-coffee \
|
20
|
+
--skip-javascript \
|
21
|
+
--skip-turbolinks \
|
22
|
+
--api
|
24
23
|
|
25
24
|
Add this line to your application's Gemfile:
|
26
25
|
|
@@ -6,8 +6,11 @@ module T2Airtime
|
|
6
6
|
if reply.success?
|
7
7
|
data = T2Airtime::Country.serialize(reply.data)
|
8
8
|
render json: {
|
9
|
-
|
10
|
-
|
9
|
+
links: {
|
10
|
+
self: request.path
|
11
|
+
},
|
12
|
+
data: data,
|
13
|
+
status: :ok
|
11
14
|
}
|
12
15
|
else
|
13
16
|
render_error(T2Airtime::Error.new(reply.error_code, reply.error_message))
|
@@ -70,8 +73,10 @@ module T2Airtime
|
|
70
73
|
|
71
74
|
def render_error(error)
|
72
75
|
render json: {
|
73
|
-
|
74
|
-
|
76
|
+
errors: [{
|
77
|
+
code: error.code,
|
78
|
+
detail: error.message
|
79
|
+
}],
|
75
80
|
status: :bad_request
|
76
81
|
}
|
77
82
|
end
|