Class: Ncba::CreditTransfer

Inherits:
Resource show all
Defined in:
lib/ncba/resources/credit_transfer.rb

Overview

CreditTransfer

Constant Summary collapse

PATH =
'/api/CreditTransfer'

Instance Attribute Summary

Attributes inherited from Resource

#args, #client

Instance Method Summary collapse

Methods inherited from Resource

#get_request, #handle_response, #initialize, #post_request

Constructor Details

This class inherits a constructor from Ncba::Resource

Instance Method Details

#bodyObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ncba/resources/credit_transfer.rb', line 14

def body
  {
    "BankCode": args[:bank_code],
    "BankSwiftCode": args[:bank_swift_code],
    "BranchCode": args[:branch_code],
    "BeneficiaryAccountName": args[:beneficiary_account_name],
    "Country": args[:country],
    "TranType": args[:transaction_type],
    "Reference": args[:reference],
    "Currency": args[:currency],
    "Account": args[:account],
    "Amount": args[:amount].to_f,
    "Narration": args[:narration],
    "Transaction Date": args[:transaction_date],
    "Validation ID": args[:validation_id],
    "SenderName": args[:sender_name],
    "Purpose of Payment": args[:purpose_of_payment],
    "Sender Principle activity": args[:sender_principle_activity],
    "Sender Address": args[:sender_address],
    "Receiver Address": args[:receiver_address],
    "Receiver ID": args[:receiver_id],
    "Sender ID": args[:sender_id],
    "BeneficiaryName": args[:beneficiary_name]
  }
end

#callObject



10
11
12
# File 'lib/ncba/resources/credit_transfer.rb', line 10

def call
  post_request(url: PATH, body: body).body
end