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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae197e105fc7596c31630070d8030e85757b0701
4
- data.tar.gz: f73403091b4c8cd4b0d6977edf60e27f5cdbdc75
3
+ metadata.gz: 380883694d9e2012b6a23f88879f44a05005efad
4
+ data.tar.gz: 3ed077121a1271feb7f0966d3d519315277c072d
5
5
  SHA512:
6
- metadata.gz: c280efca6a355e39cf15fac08767ebdc9d371d15d5baa59d04d56031e0a765d82284d017a712227d22e2b0e41dc0610477f88834ab079e81f85967f0d1e16b6a
7
- data.tar.gz: 0bcffd703b9791a30ecb138ff819ae5b4250c20f49dd867ecfc3b57457a78e686623030abaeda4146ea010dd071c729fb95c2727f3a4549c08edc13e7a99658e
6
+ metadata.gz: ebb27cede9bea986e496a2e0dcd05a3f46fff44bf33b3e020e20f723a44c6d53c9fe7c7038d9c1974ba6ffe3936b5079897a6a42447e9f1948d080152b1ded2b
7
+ data.tar.gz: a08ded72071d2d07c2dd85960051602ba70fb67f5c480b43b9e9372ffe27343778a6f3cea7249d341251071accbd2018aa3afc745c4e5daf533d1754a4afd7ac
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  /Gemfile.lock
4
4
  /_yardoc/
5
5
  /coverage/
6
- /doc/
7
6
  /pkg/
8
7
  /spec/reports/
9
8
  /tmp/
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. Requirements:
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
- rails new $APPNAME \
14
- --skip-active-record \
15
- -d postgresql \
16
- --skip-yarn \
17
- --skip-action-cable \
18
- --skip-sprockets \
19
- --skip-spring \
20
- --skip-coffee \
21
- --skip-javascript \
22
- --skip-turbolinks \
23
- --api
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
- countries: data,
10
- status: :ok
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
- code: error.code,
74
- message: error.message,
76
+ errors: [{
77
+ code: error.code,
78
+ detail: error.message
79
+ }],
75
80
  status: :bad_request
76
81
  }
77
82
  end