Class: Ncba::AccountOpening

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

Overview

Account opening

Constant Summary collapse

PATH =
'/api/AccountOpening'

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



12
13
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/ncba/resources/account_opening.rb', line 12

def body
  {
    "UniqueID": args[:uid],
    "CustomerCategory": args[:customer_category],
    "BusinessName": args[:business_name],
    "PreferedName": args[:prefered_name],
    "Street": args[:street],
    "TownCountry": args[:town_country],
    "Country": args[:country],
    "Sector": args[:sector],
    "Industry": args[:industry],
    "Nationality": args[:nationality],
    "CustEmailId": args[:email],
    "CustEmailId2": args[:emergency_email],
    "CustMobPhone": args[:phone_number],
    "Building": args[:building],
    "Website": args[:website],
    "BankName": args[:bank_name],
    "Branch": args[:branch],
    "AcctNum": args[:account_number],
    "BankAccountName": args[:bank_account_name],
    "AccountCurrency": args[:account_currency],
    "CbaAccount": args[:cba_account],
    "BankCode": args[:bank_code],
    "SwiftCode": args[:swift_code],
    "BusinessPhoneNumber": args[:business_phone_number],
    "PostalCode": args[:postal_code],
    "PostalAddress": args[:postal_address],
    "StakeHolder": {
      "Stakeholder": [
        {
          "DirShareholder": args[:stakeholder_director_shareholder],
          "StakeSurname": args[:stakeholder_surname],
          "StakeForename": args[:stakeholder_forename],
          "StakeSalutation": args[:stakeholder_salutation],
          "StakeGender": args[:stakeholder_gender],
          "StakeEmail1": args[:stakeholder_email],
          "StakeTel1": args[:stakeholder_phone],
          "StakePost": args[:stakeholder_postal_address],
          "StakeTown": args[:stakeholder_town],
          "StakePostCode": args[:stakeholder_postal_code],
          "StakeCountry": args[:stakeholder_country],
          "IDType": args[:stakeholder_id_type],
          "IDNumber": args[:stakeholder_id_number]
        }
      ]
    },
    "BusinesRegistrationNo": args[:brn]
  }
end

#callObject



8
9
10
# File 'lib/ncba/resources/account_opening.rb', line 8

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