berbix 0.0.9 → 0.0.10
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/lib/berbix.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07a9370bef12c540f5221ada05219c051922698b0d738017b97bf27e60c52deb
|
4
|
+
data.tar.gz: e075b7d20b1951b818312d6081e33da021b46247f33ece5006a9d5f8915972c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4381b67fe62cf954b963ef20ba5a859469c22bd13236dd8185f5ef48b1b0ae8c61733af48e2d5788edadd8951544b5eeb5e257f47117f8c4e53b0b830f6823fd
|
7
|
+
data.tar.gz: fafff8852c9cb95cc7f0e78f254875677dede2ca46f93c43dee21c83660efffc2ce9a03142733949f2aa04dafeb60ba81269d5570be08e93fbbcbe93f66760e5
|
data/lib/berbix.rb
CHANGED
@@ -2,7 +2,7 @@ require 'net/https'
|
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
module Berbix
|
5
|
-
SDK_VERSION = '0.0.
|
5
|
+
SDK_VERSION = '0.0.10'
|
6
6
|
CLOCK_DRIFT = 300
|
7
7
|
|
8
8
|
class HTTPClient
|
@@ -57,15 +57,16 @@ module Berbix
|
|
57
57
|
end
|
58
58
|
|
59
59
|
class Tokens
|
60
|
-
attr_reader :access_token, :client_token, :refresh_token, :expiry, :transaction_id, :user_id
|
60
|
+
attr_reader :access_token, :client_token, :refresh_token, :expiry, :transaction_id, :user_id, :response
|
61
61
|
|
62
|
-
def initialize(refresh_token, access_token=nil, client_token=nil, expiry=nil, transaction_id=nil)
|
62
|
+
def initialize(refresh_token, access_token=nil, client_token=nil, expiry=nil, transaction_id=nil, response=nil)
|
63
63
|
@refresh_token = refresh_token
|
64
64
|
@access_token = access_token
|
65
65
|
@client_token = client_token
|
66
66
|
@expiry = expiry
|
67
67
|
@transaction_id = transaction_id
|
68
68
|
@user_id = transaction_id
|
69
|
+
@response = response
|
69
70
|
end
|
70
71
|
|
71
72
|
def refresh!(access_token, client_token, expiry, transaction_id)
|
@@ -102,6 +103,7 @@ module Berbix
|
|
102
103
|
payload[:phone] = opts[:phone] unless opts[:phone].nil?
|
103
104
|
payload[:customer_uid] = opts[:customer_uid].to_s unless opts[:customer_uid].nil?
|
104
105
|
payload[:template_key] = opts[:template_key] unless opts[:template_key].nil?
|
106
|
+
payload[:hosted_options] = opts[:hosted_options] unless opts[:hosted_options].nil?
|
105
107
|
fetch_tokens('/v0/transactions', payload)
|
106
108
|
end
|
107
109
|
|
@@ -209,7 +211,8 @@ module Berbix
|
|
209
211
|
result['access_token'],
|
210
212
|
result['client_token'],
|
211
213
|
Time.now + result['expires_in'],
|
212
|
-
result['transaction_id']
|
214
|
+
result['transaction_id'],
|
215
|
+
result)
|
213
216
|
end
|
214
217
|
|
215
218
|
def auth
|