rma-payment-gateway 1.0.3 → 1.0.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8761398358087d863249d34a3d6df1a14b374829cde1fa6ae5b66fc6b42d8e3b
|
|
4
|
+
data.tar.gz: b7fdbfeb4d801c9c33ae681adfc98875eec6ad8391274563951fe1ce885a1450
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d6c84e3a1444a374259f54bf3e3459058c304d1be2e2934b773ac043fe9d01a3e5d358d16498f42966fe40e1830d4491d54b2d20c5c1bebe1db9c61c6311237e
|
|
7
|
+
data.tar.gz: ad5b6800446530c316a499b453c255bb65996aeb3acbe3fa4659e5b88fb417157bc558f7b3703579e5b3e38b5454266b677e935469d6c5ff76d317c2cc7038b3
|
|
@@ -27,15 +27,7 @@ module Rma
|
|
|
27
27
|
@transaction_id = transaction_id
|
|
28
28
|
@bank_id = bank_id
|
|
29
29
|
@account_no = account_no
|
|
30
|
-
|
|
31
|
-
body: account_inquiry_request_body
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
validate_account_inquiry_response!(response)
|
|
35
|
-
|
|
36
|
-
response
|
|
37
|
-
rescue StandardError => e
|
|
38
|
-
raise AuthenticationError, "Failed to fetch account inquiry: #{e.message}"
|
|
30
|
+
client.post(body: account_inquiry_request_body)
|
|
39
31
|
end
|
|
40
32
|
|
|
41
33
|
private
|
|
@@ -50,12 +42,6 @@ module Rma
|
|
|
50
42
|
}
|
|
51
43
|
end
|
|
52
44
|
|
|
53
|
-
def validate_account_inquiry_response!(response)
|
|
54
|
-
unless response.is_a?(Hash) && response["bfs_responseCode"] == "00"
|
|
55
|
-
error_detail = response["bfs_responseDesc"] || "Unknown error"
|
|
56
|
-
raise AuthenticationError, "Account inquiry failed: #{error_detail}"
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
45
|
end
|
|
60
46
|
end
|
|
61
47
|
end
|
|
@@ -28,13 +28,7 @@ module Rma
|
|
|
28
28
|
@amount = amount
|
|
29
29
|
@email = email
|
|
30
30
|
validate_authorization_request!
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
validate_authorization_response!(response)
|
|
34
|
-
|
|
35
|
-
response
|
|
36
|
-
rescue StandardError => e
|
|
37
|
-
raise AuthenticationError, "Failed to authorize: #{e.message}"
|
|
31
|
+
client.post(body: authorization_request_body)
|
|
38
32
|
end
|
|
39
33
|
|
|
40
34
|
private
|
|
@@ -60,13 +54,6 @@ module Rma
|
|
|
60
54
|
raise InvalidParameterError, "Email is required" if email.to_s.strip.empty?
|
|
61
55
|
raise InvalidParameterError, "Email must be a valid email" unless Utils.valid_email?(email.to_s)
|
|
62
56
|
end
|
|
63
|
-
|
|
64
|
-
def validate_authorization_response!(response)
|
|
65
|
-
unless response.is_a?(Hash) && response["bfs_responseCode"] == "00"
|
|
66
|
-
error_detail = response["bfs_responseDesc"] || "Unknown error"
|
|
67
|
-
raise AuthenticationError, "Authorization failed: #{error_detail}"
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
57
|
end
|
|
71
58
|
end
|
|
72
59
|
end
|
|
@@ -26,13 +26,7 @@ module Rma
|
|
|
26
26
|
def call(transaction_id, otp)
|
|
27
27
|
@transaction_id = transaction_id
|
|
28
28
|
@otp = otp
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
validate_debit_request_response!(response)
|
|
32
|
-
|
|
33
|
-
response
|
|
34
|
-
rescue StandardError => e
|
|
35
|
-
raise AuthenticationError, "Failed to fetch debit request: #{e.message}"
|
|
29
|
+
client.post(body: debit_request_body)
|
|
36
30
|
end
|
|
37
31
|
|
|
38
32
|
private
|
|
@@ -45,13 +39,6 @@ module Rma
|
|
|
45
39
|
bfs_msgType: "DR"
|
|
46
40
|
}
|
|
47
41
|
end
|
|
48
|
-
|
|
49
|
-
def validate_debit_request_response!(response)
|
|
50
|
-
unless response.is_a?(Hash) && response["bfs_responseCode"] == "00"
|
|
51
|
-
error_detail = response["bfs_responseDesc"] || "Unknown error"
|
|
52
|
-
raise AuthenticationError, "Debit request failed: #{error_detail}"
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
42
|
end
|
|
56
43
|
end
|
|
57
44
|
end
|