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: 7e2093f132f0620f9d9455eae15c1d2b4b2a7eb31fc4cfab608fe0244683c50b
4
- data.tar.gz: e62e9cef18f17683d4eb208f56dc09ca8d3991fa7ce7471f73dc93672d6854b0
3
+ metadata.gz: 8761398358087d863249d34a3d6df1a14b374829cde1fa6ae5b66fc6b42d8e3b
4
+ data.tar.gz: b7fdbfeb4d801c9c33ae681adfc98875eec6ad8391274563951fe1ce885a1450
5
5
  SHA512:
6
- metadata.gz: '0699e0a7456ca06ebac7a52e187b58aab1cab83ebf0cf835c10d78aa6d42891fba070094ade6ddc3d46b91d3780dd4a50783ae77fa8b83e250250a90bd3fb956'
7
- data.tar.gz: '088a8cc8091ddbbde76bf65ea34ed473e6f51a4f4a64aedbb7d0b26801a70f20a21e5cc74c24c2091d4aad87bf297e4469a0cf231838435ef3c57d20463e6f42'
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
- response = client.post(
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
- response = client.post(body: authorization_request_body)
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
- response = client.post(body: debit_request_body)
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
@@ -3,7 +3,7 @@
3
3
  module Rma
4
4
  module Payment
5
5
  module Gateway
6
- VERSION = "1.0.3"
6
+ VERSION = "1.0.4"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rma-payment-gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tashi Dendup