Module: Hws::Connectors::Hypto::VirtualAccount::Transaction

Included in:
Hws::Connectors::Hypto::VirtualAccount
Defined in:
lib/hws-connectors/hypto/virtual_account/transaction.rb

Constant Summary collapse

TXN_META_RESPONSES =
%w(id txn_time created_at txn_type charges_gst settled_amount closing_balance connected_banking transfer_udf1 transfer_udf2 transfer_udf3 transfer_initiated_account_ifsc hypto_va_id va_closing_balance va_wallet_amount)

Instance Method Summary collapse

Instance Method Details

#send_to_bank_account(request:) ⇒ Dto::PayoutResponse

Parameters:

Returns:



6
7
8
9
10
11
12
13
# File 'lib/hws-connectors/hypto/virtual_account/transaction.rb', line 6

def (request:)
  beneficiary = request.beneficiary
  payload = { reference_number: request.reference_number, number: beneficiary., ifsc: beneficiary., amount: request.amount,
              payment_type: request.payment_type, note: beneficiary.note, beneficiary_name: beneficiary.name, udf1: request.meta[:udf1],
              udf2: request.meta[:udf2], udf3: request.meta[:udf3], id: request.meta[:va_id] }
  resp = initiate_request(__method__, payload)
  to_txn_response(resp['data'], resp['message'])
end

#send_to_upi_id(request:) ⇒ Dto::PayoutResponse

Parameters:

Returns:



17
18
19
20
21
22
23
24
# File 'lib/hws-connectors/hypto/virtual_account/transaction.rb', line 17

def send_to_upi_id(request:)
  beneficiary = request.beneficiary
  payload = { reference_number: request.reference_number, upi_id: beneficiary.upi_id, amount: request.amount, payment_type: 'UPI',
              note: beneficiary.note, beneficiary_name: beneficiary.name, udf1: request.meta[:udf1],
              udf2: request.meta[:udf2], udf3: request.meta[:udf3], id: request.meta[:va_id] }
  resp = initiate_request(__method__, payload)
  to_txn_response(resp['data'], resp['message'])
end

#status(reference_number:, va_id: nil) ⇒ Dto::PayoutResponse

Parameters:

  • reference_number (String)

Returns:



28
29
30
31
32
# File 'lib/hws-connectors/hypto/virtual_account/transaction.rb', line 28

def status(reference_number:, va_id: nil)
  payload = { reference_number: reference_number, id: va_id }
  resp = initiate_request(__method__, payload)
  to_txn_response(resp['data'], resp['message'])
end