flutterwave 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/lib/flutterwave/utils/constants.rb +2 -2
- data/lib/flutterwave/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e23ef8f20069dc203fb9c392f061c0f75cba9233
|
|
4
|
+
data.tar.gz: 09d178816567b5b39a2ad0aba8986858fad50732
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cfd858b9bb5aa2b0a43b197e97cf4f4235de225cda84f8b4a3c27e20a2c7f5cac0f9e8b4bb0233316d2198c92082d69a332a7847dd38646ea6222d2eb8eb2e18
|
|
7
|
+
data.tar.gz: 384c841ed52e4af74d75b9b2ad934cb42c348399567ac4765985abd3e225c74cd46e734009c6e524af7fc1ceaba44ec727eef2b1449add4a4db67debadfed36c
|
data/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Ruby SDK for convenient access to the Flutterwave API from Ruby applications. Fu
|
|
|
7
7
|
gem install flutterwave
|
|
8
8
|
|
|
9
9
|
By default, the base API URL used is the test/staging URL - `http://staging1flutterwave.co:8080`
|
|
10
|
+
|
|
10
11
|
To change to production, set the value of the `FLUTTERWAVE_BASE_URL` environment variable to `https://prod1flutterwave.co:8181`
|
|
11
12
|
|
|
12
13
|
|
|
@@ -28,7 +29,9 @@ client = Flutterwave::Client.new(merchant_key, api_key)
|
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
## API operations
|
|
31
|
-
All API operations are performed through the client instance. API responses are used to initialize a response class that allows direct access to JSON keys as methods. Arguments to operation methods adapt the same signature as sample requests to the API endpoint.
|
|
32
|
+
All API operations are performed through the client instance. API responses are used to initialize a response class that allows direct access to JSON keys as methods. Arguments to operation methods adapt the same signature as sample requests to the API endpoint.
|
|
33
|
+
|
|
34
|
+
For instance, an API call that returns:
|
|
32
35
|
|
|
33
36
|
```json
|
|
34
37
|
{
|
|
@@ -44,6 +47,7 @@ Gets initialized as a `Flutterwave::Response` object with method keys - `respons
|
|
|
44
47
|
|
|
45
48
|
## Examples
|
|
46
49
|
An example using the wrapper for accessing https://www.flutterwave.com/documentation/alternative-payments/
|
|
50
|
+
|
|
47
51
|
The resend-otp operation could be accessed through this sample:
|
|
48
52
|
|
|
49
53
|
```ruby
|
|
@@ -56,10 +60,14 @@ response = client.account.resend({
|
|
|
56
60
|
print response.responsemessage if response.successful?
|
|
57
61
|
```
|
|
58
62
|
|
|
59
|
-
The method arguments to the resend method match the same hash-signature as the request sample at https://www.flutterwave.com/documentation/alternative-payments/#resend-otp.
|
|
63
|
+
The method arguments to the resend method match the same hash-signature as the request sample at https://www.flutterwave.com/documentation/alternative-payments/#resend-otp.
|
|
64
|
+
|
|
65
|
+
Response from the API is used to construct an instance of `Flutterwave::Response` which makes keys in the `data` hash accessible as methods.
|
|
60
66
|
|
|
61
67
|
## Banks Listing
|
|
62
|
-
The only operation that does not follow the description above is when obtaining listing of banks, alongside their codes and names. To ease operation with the listing, a `Flutterwave::Bank` object is created for each bank object returned by the API. The `Flutterwave::BankAPI` also comes with some helper methods that help find a bank by code, or by a regex matching the bank's name.
|
|
68
|
+
The only operation that does not follow the description above is when obtaining listing of banks, alongside their codes and names. To ease operation with the listing, a `Flutterwave::Bank` object is created for each bank object returned by the API. The `Flutterwave::BankAPI` also comes with some helper methods that help find a bank by code, or by a regex matching the bank's name.
|
|
69
|
+
|
|
70
|
+
An example usage is described below:
|
|
63
71
|
|
|
64
72
|
```ruby
|
|
65
73
|
client = Flutterwave::Client.new('sample_merchant_key', 'sample_api_key')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module Flutterwave
|
|
2
2
|
module Utils
|
|
3
3
|
module Constants
|
|
4
|
-
BASE_URL = ENV['FLUTTERWAVE_BASE_URL'] ||
|
|
5
|
-
'http://staging1flutterwave.co:8080'.freeze
|
|
4
|
+
BASE_URL = (ENV['FLUTTERWAVE_BASE_URL'] ||
|
|
5
|
+
'http://staging1flutterwave.co:8080').freeze
|
|
6
6
|
KEY = 'tk_0f86a4ef436f76faab1d3'.freeze
|
|
7
7
|
|
|
8
8
|
BANK = {
|
data/lib/flutterwave/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flutterwave
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tobi Oduah
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-12-
|
|
11
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|