Class: Hws::Connectors::Hypto::VirtualAccount
Defined Under Namespace
Modules: Transaction
Constant Summary
collapse
- META_RESPONSES =
%w(id account_number udf1 udf2 udf3 settle_to parent_id parent_type level hierarchy created_at updated_at link_upi upi_details)
Constants included
from Transaction
Transaction::TXN_META_RESPONSES
END_POINTS, NAME
VERSION
#send_to_bank_account, #send_to_upi_id, #status
#initialize
configure, logging?
included
Instance Method Details
37
38
39
40
41
|
# File 'lib/hws-connectors/hypto/virtual_account/base.rb', line 37
def activate(reference_number:)
payload = { id: reference_number }
resp = initiate_request(__method__, payload)
to_response(resp['data'], resp['message'])
end
|
8
9
10
11
12
13
14
15
16
|
# File 'lib/hws-connectors/hypto/virtual_account/base.rb', line 8
def create(request:)
payload = { reference_number: request.reference_number, udf1: request.meta[:udf1], udf2: request.meta[:udf2], udf3: request.meta[:udf3],
parent_id: request.meta[:parent_id], link_upi: request.meta[:link_upi], upi_name: request.meta[:upi_name],
whitelisted_remitters: request.remitters.map { |remitter| { number: remitter.beneficiary.account_number, ifsc: remitter.beneficiary.account_ifsc } } }
payload[:settle_to] = request.meta[:settle_to] if request.meta[:settle_to].present?
payload[:parent_type] = request.meta[:parent_type] if request.meta[:parent_type].present?
resp = initiate_request(__method__, payload)
to_response(resp['data']['virtual_account'], resp['message'])
end
|
45
46
47
48
49
|
# File 'lib/hws-connectors/hypto/virtual_account/base.rb', line 45
def deactivate(reference_number:)
payload = { id: reference_number }
resp = initiate_request(__method__, payload)
to_response(resp['data'], resp['message'])
end
|
20
21
22
23
24
|
# File 'lib/hws-connectors/hypto/virtual_account/base.rb', line 20
def fetch(reference_number:)
payload = { id: reference_number }
resp = initiate_request(__method__, payload)
to_response(resp['data'], resp['message'])
end
|
28
29
30
31
32
33
|
# File 'lib/hws-connectors/hypto/virtual_account/base.rb', line 28
def update(request:)
payload = { id: request.meta[:id], reference_number: request.reference_number, udf1: request.meta[:udf1], udf2: request.meta[:udf2], udf3: request.meta[:udf3],
whitelisted_remitters: request.remitters.map { |remitter| { number: remitter.beneficiary.account_number, ifsc: remitter.beneficiary.account_ifsc } } }
resp = initiate_request(__method__, payload)
to_response(resp['data']['virtual_account'], resp['message'])
end
|