Class: Rma::Payment::Gateway::AccountInquiry

Inherits:
Object
  • Object
show all
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.

Examples:

auth = Rma::Payment::Gateway::AccountInquiry.new(client)
auth.call(transaction_id, bank_id, )

Instance Attribute Summary collapse

Instance Method Summary collapse

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_noObject (readonly)

Returns the value of attribute account_no.



18
19
20
# File 'lib/rma/payment/gateway/account_inquiry.rb', line 18

def 
  @account_no
end

#bank_idObject (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

#clientObject (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_idObject (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, )
  @transaction_id = transaction_id
  @bank_id = bank_id
  @account_no = 
  response = client.post(
    body: 
  )

  (response)

  response["result"]
rescue StandardError => e
  raise AuthenticationError, "Failed to fetch account inquiry: #{e.message}"
end