paymentsds-mpesa 0.1.0.pre.alpha.36 → 0.1.0.pre.alpha.37
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/errors/constants.rb +29 -29
- data/lib/paymentsds/mpesa/service.rb +9 -9
- data/lib/paymentsds/mpesa/version.rb +1 -1
- 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: 03f6b0c05d7c834460b07bb276ebcaf2d4f96c8ae84d0517549eece4a37fc2e9
|
4
|
+
data.tar.gz: 6bf1dfb79f71559379e8dbb50d565bc77a9017adfad4e3718e8ce28fda260bdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ef496fef3547aa79223025760dcdf334e527700d2e2f5382bc6c851142445727f9518c9fdeb045a1e1c14aafec36b2cd0cd3278924206d37457d183deac5d8
|
7
|
+
data.tar.gz: e95ea265812384153afcc9473d94a5247326c137ae00b7c18577ad9e545b1d209ef1a822dcf8c07751beb1a9750b660171e070dab27bd56915c90e10dbe921aa
|
@@ -1,34 +1,34 @@
|
|
1
1
|
module Paymentsds
|
2
2
|
module MPesa
|
3
|
-
INS0 = "INS-0".
|
4
|
-
INS1 = "INS-1".
|
5
|
-
INS5 = "INS-5".
|
6
|
-
INS6 = "INS-6".
|
7
|
-
INS9 = "INS-9".
|
8
|
-
INS10 = "INS-10".
|
9
|
-
INS13 = "INS-13".
|
10
|
-
INS14 = "INS-14".
|
11
|
-
INS15 = "INS-15".
|
12
|
-
INS16 = "INS-16".
|
13
|
-
INS17 = "INS-17".
|
14
|
-
INS18 = "INS-18".
|
15
|
-
INS19 = "INS-19".
|
16
|
-
INS20 = "INS-20".
|
17
|
-
INS21 = "INS-21".
|
18
|
-
INS22 = "INS-22".
|
19
|
-
INS23 = "INS-23".
|
20
|
-
INS24 = "INS-24".
|
21
|
-
INS25 = "INS-25".
|
22
|
-
INS993 = "INS-993".
|
23
|
-
INS994 = "INS-994".
|
24
|
-
INS995 = "INS-995".
|
25
|
-
INS996 = "INS-996".
|
26
|
-
INS997 = "INS-997".
|
27
|
-
INS998 = "INS-998".
|
28
|
-
INS2001 = "INS-2001".
|
29
|
-
INS2002 = "INS-2002".
|
30
|
-
INS2051 = "INS-2051".
|
31
|
-
INS2057 = "INS-2057".
|
3
|
+
INS0 = "INS-0".to_sym
|
4
|
+
INS1 = "INS-1".to_sym
|
5
|
+
INS5 = "INS-5".to_sym
|
6
|
+
INS6 = "INS-6".to_sym
|
7
|
+
INS9 = "INS-9".to_sym
|
8
|
+
INS10 = "INS-10".to_sym
|
9
|
+
INS13 = "INS-13".to_sym
|
10
|
+
INS14 = "INS-14".to_sym
|
11
|
+
INS15 = "INS-15".to_sym
|
12
|
+
INS16 = "INS-16".to_sym
|
13
|
+
INS17 = "INS-17".to_sym
|
14
|
+
INS18 = "INS-18".to_sym
|
15
|
+
INS19 = "INS-19".to_sym
|
16
|
+
INS20 = "INS-20".to_sym
|
17
|
+
INS21 = "INS-21".to_sym
|
18
|
+
INS22 = "INS-22".to_sym
|
19
|
+
INS23 = "INS-23".to_sym
|
20
|
+
INS24 = "INS-24".to_sym
|
21
|
+
INS25 = "INS-25".to_sym
|
22
|
+
INS993 = "INS-993".to_sym
|
23
|
+
INS994 = "INS-994".to_sym
|
24
|
+
INS995 = "INS-995".to_sym
|
25
|
+
INS996 = "INS-996".to_sym
|
26
|
+
INS997 = "INS-997".to_sym
|
27
|
+
INS998 = "INS-998".to_sym
|
28
|
+
INS2001 = "INS-2001".to_sym
|
29
|
+
INS2002 = "INS-2002".to_sym
|
30
|
+
INS2051 = "INS-2051".to_sym
|
31
|
+
INS2057 = "INS-2057".to_sym
|
32
32
|
|
33
33
|
DIRECT_DEBT = "DIRECT_DEBT".freeze
|
34
34
|
DUPLICATE_TRANSACTION = "DUPLICATE_TRANSACTION".freeze
|
@@ -184,7 +184,7 @@ module Paymentsds
|
|
184
184
|
|
185
185
|
case result.status
|
186
186
|
when 200
|
187
|
-
case result.body[:output_ResponseCode]
|
187
|
+
case result.body[:output_ResponseCode].to_sym
|
188
188
|
when Paymentsds::MPesa::INS0
|
189
189
|
response = Paymentsds::MPesa::Result.new(result.success?, nil, result.body)
|
190
190
|
else
|
@@ -192,7 +192,7 @@ module Paymentsds
|
|
192
192
|
end
|
193
193
|
|
194
194
|
when 201
|
195
|
-
case result.body[:output_ResponseCode]
|
195
|
+
case result.body[:output_ResponseCode].to_sym
|
196
196
|
when Paymentsds::MPesa::INS0
|
197
197
|
response = Paymentsds::MPesa::Result.new(result.success?, nil, result.body)
|
198
198
|
else
|
@@ -200,7 +200,7 @@ module Paymentsds
|
|
200
200
|
end
|
201
201
|
|
202
202
|
when 400
|
203
|
-
case result.body[:output_ResponseCode]
|
203
|
+
case result.body[:output_ResponseCode].to_sym
|
204
204
|
when Paymentsds::MPesa::INS13
|
205
205
|
raise InvalidShortcodeError
|
206
206
|
when Paymentsds::MPesa::INS14
|
@@ -250,7 +250,7 @@ module Paymentsds
|
|
250
250
|
end
|
251
251
|
|
252
252
|
when 401
|
253
|
-
case result.body[:output_ResponseCode]
|
253
|
+
case result.body[:output_ResponseCode].to_sym
|
254
254
|
when Paymentsds::MPesa::INS5
|
255
255
|
raise TransactionCancelledError
|
256
256
|
when Paymentsds::MPesa::INS6
|
@@ -260,7 +260,7 @@ module Paymentsds
|
|
260
260
|
end
|
261
261
|
|
262
262
|
when 408
|
263
|
-
case result.body[:output_ResponseCode]
|
263
|
+
case result.body[:output_ResponseCode].to_sym
|
264
264
|
when Paymentsds::MPesa::INS9
|
265
265
|
raise RequestTimeoutError
|
266
266
|
else
|
@@ -268,7 +268,7 @@ module Paymentsds
|
|
268
268
|
end
|
269
269
|
|
270
270
|
when 409
|
271
|
-
case result.body[:output_ResponseCode]
|
271
|
+
case result.body[:output_ResponseCode].to_sym
|
272
272
|
when Paymentsds::MPesa::INS10
|
273
273
|
raise DuplicateTransactionError
|
274
274
|
else
|
@@ -276,7 +276,7 @@ module Paymentsds
|
|
276
276
|
end
|
277
277
|
|
278
278
|
when 422
|
279
|
-
case result.body[:output_ResponseCode]
|
279
|
+
case result.body[:output_ResponseCode].to_sym
|
280
280
|
when Paymentsds::MPesa::INS2006
|
281
281
|
raise InsufficientBalanceError
|
282
282
|
else
|
@@ -284,7 +284,7 @@ module Paymentsds
|
|
284
284
|
end
|
285
285
|
|
286
286
|
when 500
|
287
|
-
case result.body[:output_ResponseCode]
|
287
|
+
case result.body[:output_ResponseCode].to_sym
|
288
288
|
when Paymentsds::MPesa::INS1
|
289
289
|
raise InternalError
|
290
290
|
else
|
@@ -292,7 +292,7 @@ module Paymentsds
|
|
292
292
|
end
|
293
293
|
|
294
294
|
when 503
|
295
|
-
case result.body[:output_ResponseCode]
|
295
|
+
case result.body[:output_ResponseCode].to_sym
|
296
296
|
when Paymentsds::MPesa::INS16
|
297
297
|
raise UnavailableServerError
|
298
298
|
else
|