Class: Rma::Payment::Gateway::AccountInquiry
- Inherits:
-
Object
- Object
- Rma::Payment::Gateway::AccountInquiry
- Defined in:
- lib/rma/payment/gateway/account_inquiry.rb
Overview
Account Inquiry class for RMA Payment Gateway. Handles account inquiry for the RMA Payment Gateway client.
Instance Attribute Summary collapse
-
#account_no ⇒ Object
readonly
Returns the value of attribute account_no.
-
#bank_id ⇒ Object
readonly
Returns the value of attribute bank_id.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Instance Method Summary collapse
-
#call(transaction_id, bank_id, account_no) ⇒ Object
Fetch account inquiry Returns the account inquiry response.
-
#initialize(client) ⇒ AccountInquiry
constructor
A new instance of AccountInquiry.
Constructor Details
#initialize(client) ⇒ AccountInquiry
Returns a new instance of AccountInquiry.
20 21 22 |
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 20 def initialize(client) @client = client end |
Instance Attribute Details
#account_no ⇒ Object (readonly)
Returns the value of attribute account_no.
18 19 20 |
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 18 def account_no @account_no end |
#bank_id ⇒ Object (readonly)
Returns the value of attribute bank_id.
18 19 20 |
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 18 def bank_id @bank_id end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
18 19 20 |
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 18 def client @client end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
18 19 20 |
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 18 def transaction_id @transaction_id end |
Instance Method Details
#call(transaction_id, bank_id, account_no) ⇒ Object
Fetch account inquiry Returns the account inquiry response
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 26 def call(transaction_id, bank_id, account_no) @transaction_id = transaction_id @bank_id = bank_id @account_no = account_no response = client.post( body: account_inquiry_request_body ) validate_account_inquiry_response!(response) response["result"] rescue StandardError => e raise AuthenticationError, "Failed to fetch account inquiry: #{e.}" end |