paymentsds-mpesa 0.1.0.pre.alpha.33 → 0.1.0.pre.alpha.38
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: 675d48b13407aa5ffbe713de8eec555cacb3649e44ac88d367b5694dcd15c2e7
|
4
|
+
data.tar.gz: c5d50f2394a781a20f7c3672b8db00648fc50a2ebba7a11311a177defe0c18a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d38023c061681a3639b2f4ec8294b27135cf341f86cf3980469eccf3e1734bfb88406a5e1bcf76128cb113cc2acddffb613a82f1eddbad2298391306d1d025c7
|
7
|
+
data.tar.gz: 6c8fb1622107e2825b3c7aeebb0783ceefc84a22503fac6fe7ea5afa35c97294b00f246ba64424a32283da34bfa27516adecc76682027e74ed5ef3b74e7f5c0e
|
@@ -1,51 +1,60 @@
|
|
1
1
|
module Paymentsds
|
2
2
|
module MPesa
|
3
|
-
INS0 = "INS-0"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
22
32
|
|
23
|
-
DIRECT_DEBT = "DIRECT_DEBT"
|
24
|
-
DUPLICATE_TRANSACTION = "DUPLICATE_TRANSACTION"
|
25
|
-
INSUFICIENT_BALANCE = "INSUFICIENT_BALANCE"
|
26
|
-
INVALID_AMOUNT = "INVALID_AMOUNT"
|
27
|
-
INVALID_MISSING_PROPERTIES = "INVALID_MISSING_PROPERTIES"
|
28
|
-
INVALID_RECEIVER = "INVALID_RECEIVER"
|
29
|
-
INVALID_REFERENCE = "INVALID_REFERENCE"
|
30
|
-
INVALID_SECURITY_CREDENTIAL = "INVALID_SECURITY_CREDENTIAL"
|
31
|
-
INVALID_SHORTCODE = "INVALID_SHORTCODE"
|
32
|
-
INVALID_THIRDPARTY_REFERENCE = "INVALID_THIRDPARTY_REFERENCE"
|
33
|
-
INVALID_TRANSACTION_ID = "INVALID_TRANSACTION_ID"
|
34
|
-
INVALID_TRANSACTION_REFERENCE = "INVALID_TRANSACTION_INVALID_TRANSACTION_REFERENCE"
|
35
|
-
REQUEST_TIMEOUT = "REQUEST_TIMEOUT"
|
36
|
-
TRANSACTION_CANCELLED = "TRANSACTION_CANCELLED"
|
37
|
-
TRANSACTION_FAILED = "TRANSACTION_FAILED"
|
38
|
-
UNAVAILABLE_SERVER = "UNAVAILABLE_SERVER"
|
39
|
-
UNKNOWN_STATUS = "UNKNOWN_STATUS"
|
40
|
-
UNKNOWN = "UNKNOWN"
|
41
|
-
VALIDATION = "VALIDATION"
|
42
|
-
INVALID_INITIATOR_IDENTIFIER = "INVALID_INITIATOR_IDENTIFIER"
|
43
|
-
INVALID_LANGUAGE_CODE = "INVALID_LANGUAGE_CODE"
|
44
|
-
INVALID_MARKET = "INVALID_MARKET"
|
45
|
-
INVALID_MSISDN = "INVALID_MSISDN"
|
46
|
-
PROFILE_PROBLEMS = "PROFILE_PROBLEMS"
|
47
|
-
INACTIVE_ACCOUNT = "INACTIVE_ACCOUNT"
|
48
|
-
INITIATOR_AUTHENTICATION = "INITIATOR_AUTHENTICATION"
|
49
|
-
PROFILE_PROBLEMS = "PROFILE_PROBLEMS"
|
33
|
+
DIRECT_DEBT = "DIRECT_DEBT".freeze
|
34
|
+
DUPLICATE_TRANSACTION = "DUPLICATE_TRANSACTION".freeze
|
35
|
+
INSUFICIENT_BALANCE = "INSUFICIENT_BALANCE".freeze
|
36
|
+
INVALID_AMOUNT = "INVALID_AMOUNT".freeze
|
37
|
+
INVALID_MISSING_PROPERTIES = "INVALID_MISSING_PROPERTIES".freeze
|
38
|
+
INVALID_RECEIVER = "INVALID_RECEIVER".freeze
|
39
|
+
INVALID_REFERENCE = "INVALID_REFERENCE".freeze
|
40
|
+
INVALID_SECURITY_CREDENTIAL = "INVALID_SECURITY_CREDENTIAL".freeze
|
41
|
+
INVALID_SHORTCODE = "INVALID_SHORTCODE".freeze
|
42
|
+
INVALID_THIRDPARTY_REFERENCE = "INVALID_THIRDPARTY_REFERENCE".freeze
|
43
|
+
INVALID_TRANSACTION_ID = "INVALID_TRANSACTION_ID".freeze
|
44
|
+
INVALID_TRANSACTION_REFERENCE = "INVALID_TRANSACTION_INVALID_TRANSACTION_REFERENCE".freeze
|
45
|
+
REQUEST_TIMEOUT = "REQUEST_TIMEOUT".freeze
|
46
|
+
TRANSACTION_CANCELLED = "TRANSACTION_CANCELLED".freeze
|
47
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED".freeze
|
48
|
+
UNAVAILABLE_SERVER = "UNAVAILABLE_SERVER".freeze
|
49
|
+
UNKNOWN_STATUS = "UNKNOWN_STATUS".freeze
|
50
|
+
UNKNOWN = "UNKNOWN".freeze
|
51
|
+
VALIDATION = "VALIDATION".freeze
|
52
|
+
INVALID_INITIATOR_IDENTIFIER = "INVALID_INITIATOR_IDENTIFIER".freeze
|
53
|
+
INVALID_LANGUAGE_CODE = "INVALID_LANGUAGE_CODE".freeze
|
54
|
+
INVALID_MARKET = "INVALID_MARKET".freeze
|
55
|
+
INVALID_MSISDN = "INVALID_MSISDN".freeze
|
56
|
+
PROFILE_PROBLEMS = "PROFILE_PROBLEMS".freeze
|
57
|
+
INACTIVE_ACCOUNT = "INACTIVE_ACCOUNT".freeze
|
58
|
+
INITIATOR_AUTHENTICATION = "INITIATOR_AUTHENTICATION".freeze
|
50
59
|
end
|
51
60
|
end
|
@@ -180,10 +180,11 @@ module Paymentsds
|
|
180
180
|
end
|
181
181
|
|
182
182
|
def build_response(result)
|
183
|
+
puts result.body.inspect
|
183
184
|
|
184
185
|
case result.status
|
185
186
|
when 200
|
186
|
-
case result.body[
|
187
|
+
case result.body["output_ResponseCode"].to_sym
|
187
188
|
when Paymentsds::MPesa::INS0
|
188
189
|
response = Paymentsds::MPesa::Result.new(result.success?, nil, result.body)
|
189
190
|
else
|
@@ -191,7 +192,7 @@ module Paymentsds
|
|
191
192
|
end
|
192
193
|
|
193
194
|
when 201
|
194
|
-
case result.body[
|
195
|
+
case result.body["output_ResponseCode"].to_sym
|
195
196
|
when Paymentsds::MPesa::INS0
|
196
197
|
response = Paymentsds::MPesa::Result.new(result.success?, nil, result.body)
|
197
198
|
else
|
@@ -199,7 +200,7 @@ module Paymentsds
|
|
199
200
|
end
|
200
201
|
|
201
202
|
when 400
|
202
|
-
case result.body[
|
203
|
+
case result.body["output_ResponseCode"].to_sym
|
203
204
|
when Paymentsds::MPesa::INS13
|
204
205
|
raise InvalidShortcodeError
|
205
206
|
when Paymentsds::MPesa::INS14
|
@@ -249,7 +250,7 @@ module Paymentsds
|
|
249
250
|
end
|
250
251
|
|
251
252
|
when 401
|
252
|
-
case result.body[
|
253
|
+
case result.body["output_ResponseCode"].to_sym
|
253
254
|
when Paymentsds::MPesa::INS5
|
254
255
|
raise TransactionCancelledError
|
255
256
|
when Paymentsds::MPesa::INS6
|
@@ -259,7 +260,7 @@ module Paymentsds
|
|
259
260
|
end
|
260
261
|
|
261
262
|
when 408
|
262
|
-
case result.body[
|
263
|
+
case result.body["output_ResponseCode"].to_sym
|
263
264
|
when Paymentsds::MPesa::INS9
|
264
265
|
raise RequestTimeoutError
|
265
266
|
else
|
@@ -267,7 +268,7 @@ module Paymentsds
|
|
267
268
|
end
|
268
269
|
|
269
270
|
when 409
|
270
|
-
case result.body[
|
271
|
+
case result.body["output_ResponseCode"].to_sym
|
271
272
|
when Paymentsds::MPesa::INS10
|
272
273
|
raise DuplicateTransactionError
|
273
274
|
else
|
@@ -275,7 +276,7 @@ module Paymentsds
|
|
275
276
|
end
|
276
277
|
|
277
278
|
when 422
|
278
|
-
case result.body[
|
279
|
+
case result.body["output_ResponseCode"].to_sym
|
279
280
|
when Paymentsds::MPesa::INS2006
|
280
281
|
raise InsufficientBalanceError
|
281
282
|
else
|
@@ -283,7 +284,7 @@ module Paymentsds
|
|
283
284
|
end
|
284
285
|
|
285
286
|
when 500
|
286
|
-
case result.body[
|
287
|
+
case result.body["output_ResponseCode"].to_sym
|
287
288
|
when Paymentsds::MPesa::INS1
|
288
289
|
raise InternalError
|
289
290
|
else
|
@@ -291,7 +292,7 @@ module Paymentsds
|
|
291
292
|
end
|
292
293
|
|
293
294
|
when 503
|
294
|
-
case result.body[
|
295
|
+
case result.body["output_ResponseCode"].to_sym
|
295
296
|
when Paymentsds::MPesa::INS16
|
296
297
|
raise UnavailableServerError
|
297
298
|
else
|