Class: DkPaymentGateway::IntraTransaction
- Inherits:
-
Object
- Object
- DkPaymentGateway::IntraTransaction
- Defined in:
- lib/dk_payment_gateway/intra_transaction.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#account_inquiry(params) ⇒ Hash
Intra (DK - DK) Beneficiary Account Inquiry Validates beneficiary account details before initiating a fund transfer.
-
#fund_transfer(params) ⇒ Hash
Intra (DK - DK) Fund Transfer Initiates a fund transfer after successful account inquiry.
-
#initialize(client) ⇒ IntraTransaction
constructor
A new instance of IntraTransaction.
Constructor Details
#initialize(client) ⇒ IntraTransaction
Returns a new instance of IntraTransaction.
7 8 9 |
# File 'lib/dk_payment_gateway/intra_transaction.rb', line 7 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/dk_payment_gateway/intra_transaction.rb', line 5 def client @client end |
Instance Method Details
#account_inquiry(params) ⇒ Hash
Intra (DK - DK) Beneficiary Account Inquiry Validates beneficiary account details before initiating a fund transfer
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dk_payment_gateway/intra_transaction.rb', line 24 def account_inquiry(params) validate_inquiry_params!(params) request_body = build_inquiry_body(params) signature_headers = generate_signature_headers(request_body) response = client.post( '/v1/beneficiary/account_inquiry', body: request_body.to_json, headers: signature_headers ) validate_response!(response, 'Account Inquiry') response['response_data'] end |
#fund_transfer(params) ⇒ Hash
Intra (DK - DK) Fund Transfer Initiates a fund transfer after successful account inquiry
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/dk_payment_gateway/intra_transaction.rb', line 59 def fund_transfer(params) validate_transfer_params!(params) request_body = build_transfer_body(params) signature_headers = generate_signature_headers(request_body) response = client.post( '/v1/initiate/transaction', body: request_body.to_json, headers: signature_headers ) validate_response!(response, 'Fund Transfer') response['response_data'] end |