paymentsds-mpesa 0.1.0.pre.alpha.26 → 0.1.0.pre.alpha.27
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/paymentsds/mpesa/service.rb +10 -5
- data/lib/paymentsds/mpesa/version.rb +2 -2
- 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: 6af0c9d99ed40864b592134ec7dba1896348da77525a6a7f748d1124a28b57c9
|
4
|
+
data.tar.gz: 66c7f14a413d93480182372ecf673a1b040569fb0ab0210cda9db5d9eee185fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5773f8c8a3d6d43b0245104f27e385dfe2ca2666ecd265cbc981f0d352da79ea7806db4089a275f295af612bc9c2dfeb95812de5d1480e3e865038eb65dcf96b
|
7
|
+
data.tar.gz: a4ab7bc50b4da802fe0ebd55e3cf0600b9f85c399ad5084ac70cea16b6295826e9a7f0c2ceedb7c11193f961145c0c271b0bf76774d749fa3c595c5190e2f438
|
@@ -147,10 +147,10 @@ module Paymentsds
|
|
147
147
|
body: build_request_body(opcode, intent)
|
148
148
|
}
|
149
149
|
|
150
|
-
http_client = Faraday.new(
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
http_client = Faraday.new(url: request_data[:base_url]) do |client|
|
151
|
+
client.headers = request_data[:headers]
|
152
|
+
client.response :json
|
153
|
+
end
|
154
154
|
|
155
155
|
puts request_data[:base_url]
|
156
156
|
|
@@ -180,8 +180,13 @@ module Paymentsds
|
|
180
180
|
def build_response(result)
|
181
181
|
puts result.inspect
|
182
182
|
|
183
|
-
if result.status
|
183
|
+
if result.status < 300
|
184
184
|
response = Paymentsds::MPesa::Result.new(result.success?, nil, result.data)
|
185
|
+
elsif result.status < 400
|
186
|
+
case re
|
187
|
+
elsif result.status < 500
|
188
|
+
elsif result.status < 600
|
189
|
+
else
|
185
190
|
end
|
186
191
|
|
187
192
|
end
|