paymentsds-mpesa 0.1.0.pre.alpha.19 → 0.1.0.pre.alpha.24
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac19c06619d908dd6793d11cd47eee50653e7b7ff1a4a531f14d5e23622038e1
|
4
|
+
data.tar.gz: 309c4ec2f7b3a57bafd47e15c731bca9c0be66a6b6349b7ae395060377837272
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18aba3c12a9d75a08d639f18bf78552b84bf42935e1496acbeef9e3dcabc095fcf5458ea84012408047fd2a16f915c9fa7c3f3467202fbe4a258680bf40eecb1
|
7
|
+
data.tar.gz: fa82503513c9d85bb652ef783984e885f07af98aa4fa939efb7d6eca8912458649b8ed34f15bb14c9bc5bd351cc67e174776c345b41c4bdf19a8002103ded654
|
@@ -4,10 +4,14 @@ module Paymentsds
|
|
4
4
|
attr_accessor :scheme
|
5
5
|
attr_accessor :domain
|
6
6
|
|
7
|
-
def initialize(scheme,
|
7
|
+
def initialize(scheme, domain)
|
8
8
|
@scheme = scheme
|
9
9
|
@domain = domain
|
10
10
|
end
|
11
|
+
|
12
|
+
def to_url
|
13
|
+
"#{@scheme}://#{@domain}"
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
@@ -138,12 +138,12 @@ module Paymentsds
|
|
138
138
|
generate_access_token
|
139
139
|
|
140
140
|
request_data = {
|
141
|
-
base_url: "#{@config.environment.
|
141
|
+
base_url: "#{@config.environment.to_url}:#{operation[:port]}",
|
142
142
|
url: operation[:path],
|
143
143
|
method: operation[:method],
|
144
144
|
path: operation[:path],
|
145
145
|
headers: build_request_headers,
|
146
|
-
timeout: @config.timeout
|
146
|
+
timeout: @config.timeout,
|
147
147
|
body: build_request_body(opcode, intent)
|
148
148
|
}
|
149
149
|
|
@@ -174,10 +174,12 @@ module Paymentsds
|
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
177
|
-
|
177
|
+
build_response(response)
|
178
178
|
end
|
179
179
|
|
180
180
|
def build_response(result)
|
181
|
+
puts result.inspect
|
182
|
+
|
181
183
|
if result.status >= 200 && result.status < 300
|
182
184
|
response = Paymentsds::MPesa::Response.new(result.success?, nil, result.data)
|
183
185
|
end
|