gladepay 0.1.2 → 0.1.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +3 -0
- data/lib/gladepay/version.rb +1 -1
- data/lib/gladepay.rb +14 -3
- 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: 348f59ad27a88b13265f2be4c716af52989fd622
|
4
|
+
data.tar.gz: a7f03b7650b48889fe7ce492f38c12314e50ef69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8829da2af8bc4bd3fc1c7261e187657433a7a37c83b0e2a45962677ea5c959cb5ef8ce6cb6b4dc451dec46f9543599fa8d596230673eaad6b7d38fd417ada7de
|
7
|
+
data.tar.gz: c3b799e7adc61417f1f77c7aef41283514d85674f30fba2d68f4a847b7e7b07dde539e82da4b1c9321d48a256943247b8321717e13af74e38e25a1e3b7353667
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -94,6 +94,9 @@ Or install it yourself as:
|
|
94
94
|
#Get the charges applicable to a card: (first six digit of the card no)
|
95
95
|
card_charges_response = gladepay.card_charges(amount, card_no)
|
96
96
|
|
97
|
+
#Get the charges applicable to an account
|
98
|
+
account_charges_response = gladepay.account_charges(amount)
|
99
|
+
|
97
100
|
#charge with token
|
98
101
|
response = gladepay.charge_with_token(
|
99
102
|
user,
|
data/lib/gladepay/version.rb
CHANGED
data/lib/gladepay.rb
CHANGED
@@ -220,6 +220,16 @@ class Gladepay
|
|
220
220
|
return response
|
221
221
|
end
|
222
222
|
|
223
|
+
def account_charges(amount)
|
224
|
+
request_data = {
|
225
|
+
'inquire' => 'charges',
|
226
|
+
'type' => 'account',
|
227
|
+
'amount' => amount
|
228
|
+
}
|
229
|
+
response = call_put_api('resources', request_data)
|
230
|
+
return response
|
231
|
+
end
|
232
|
+
|
223
233
|
def validate_otp(txn_ref, otp)
|
224
234
|
request_data = {
|
225
235
|
'action' => 'validate',
|
@@ -286,10 +296,11 @@ class Gladepay
|
|
286
296
|
end
|
287
297
|
|
288
298
|
result = JSON.parse(response.body)
|
289
|
-
|
290
|
-
# puts result
|
299
|
+
puts 'CALL_PUT_API:-RESULT ', result
|
291
300
|
|
292
|
-
|
301
|
+
unless (result.instance_of? Integer) != false
|
302
|
+
raise GladepayServerError.new(response), 'Server Message: '. result['message'].to_s unless result['status'] != 0
|
303
|
+
end
|
293
304
|
rescue JSON::ParserError => jsonerr
|
294
305
|
raise GladepayServerError.new(response), 'Invalid result data. Could not parse JSON response body \n' + jsonerr.message
|
295
306
|
rescue GladepayServerError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gladepay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.2
|
4
|
+
version: 0.1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chinaka Light
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|