Class: CapitalOnTap::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/capital_on_tap/application.rb

Constant Summary collapse

SALUTATIONS =
%w[Mr Mrs Miss Ms Dr].freeze
BUSINESS_TYPES =
%w[SoleTrader Partnership LimitedCompany LimitedLiabilityPartnership].freeze
DEFAULT_PARAMS =
{
  CustomerId: nil,
  Salutation: 'Mr',
  FirstName: 'Amjed',
  MiddleName: '',
  LastName: 'Ali',
  DateOfBirth: '1967-07-14T00:00:00+01:00',
  MobilePhone: '07841580124',
  HomePhone: nil,
  EmailAddress: nil,
  MonthlyIncome: nil,
  MonthlyExpenditure: nil,
  PersonalAddress: {},
  TradingName: 'Glamour Bikinis And Clothing Boutique Limited',
  BusinessLegalName: 'Glamour Bikinis And Clothing Boutique Limited',
  BusinessLandline: '07874186570',
  YearsTrading: 8,
  MonthlyTurnOver: 10_000,
  BusinessType: 'LimitedCompany',
  RegistrationNumber: 10_322_035,
  BusinessAddress: {},
  PromoCode: nil,
  OnPasteEventFields: nil,
  MonthlyBusinessExpenditure: nil,
  GoogleSessionId: nil,
  PartnerCode: nil,
  ExternalReference: nil,
  RestrictedCountries: false,
  RequestedCredit: 10_000,
  ApplicationGuid: nil
}.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#business_addressObject

Returns the value of attribute business_address.



13
14
15
# File 'lib/capital_on_tap/application.rb', line 13

def business_address
  @business_address
end

#business_land_lineObject

Returns the value of attribute business_land_line.



12
13
14
# File 'lib/capital_on_tap/application.rb', line 12

def business_land_line
  @business_land_line
end

Returns the value of attribute business_legal_name.



12
13
14
# File 'lib/capital_on_tap/application.rb', line 12

def business_legal_name
  @business_legal_name
end

#business_typeObject

Returns the value of attribute business_type.



13
14
15
# File 'lib/capital_on_tap/application.rb', line 13

def business_type
  @business_type
end

#customer_uses_personal_bank_account_for_businessObject

Returns the value of attribute customer_uses_personal_bank_account_for_business.



10
11
12
# File 'lib/capital_on_tap/application.rb', line 10

def 
  @customer_uses_personal_bank_account_for_business
end

#date_of_birthObject

Returns the value of attribute date_of_birth.



9
10
11
# File 'lib/capital_on_tap/application.rb', line 9

def date_of_birth
  @date_of_birth
end

#email_addressObject

Returns the value of attribute email_address.



10
11
12
# File 'lib/capital_on_tap/application.rb', line 10

def email_address
  @email_address
end

#external_referenceObject

Returns the value of attribute external_reference.



15
16
17
# File 'lib/capital_on_tap/application.rb', line 15

def external_reference
  @external_reference
end

#first_nameObject

Returns the value of attribute first_name.



9
10
11
# File 'lib/capital_on_tap/application.rb', line 9

def first_name
  @first_name
end

#home_phoneObject

Returns the value of attribute home_phone.



10
11
12
# File 'lib/capital_on_tap/application.rb', line 10

def home_phone
  @home_phone
end

#last_nameObject

Returns the value of attribute last_name.



9
10
11
# File 'lib/capital_on_tap/application.rb', line 9

def last_name
  @last_name
end

#middle_nameObject

Returns the value of attribute middle_name.



9
10
11
# File 'lib/capital_on_tap/application.rb', line 9

def middle_name
  @middle_name
end

#mobile_phoneObject

Returns the value of attribute mobile_phone.



9
10
11
# File 'lib/capital_on_tap/application.rb', line 9

def mobile_phone
  @mobile_phone
end

#monthly_expenditureObject

Returns the value of attribute monthly_expenditure.



11
12
13
# File 'lib/capital_on_tap/application.rb', line 11

def monthly_expenditure
  @monthly_expenditure
end

#monthly_incomeObject

Returns the value of attribute monthly_income.



11
12
13
# File 'lib/capital_on_tap/application.rb', line 11

def monthly_income
  @monthly_income
end

#monthly_turn_overObject

Returns the value of attribute monthly_turn_over.



13
14
15
# File 'lib/capital_on_tap/application.rb', line 13

def monthly_turn_over
  @monthly_turn_over
end

#montly_business_expenditureObject

Returns the value of attribute montly_business_expenditure.



14
15
16
# File 'lib/capital_on_tap/application.rb', line 14

def montly_business_expenditure
  @montly_business_expenditure
end

#on_paste_event_fieldsObject

Returns the value of attribute on_paste_event_fields.



14
15
16
# File 'lib/capital_on_tap/application.rb', line 14

def on_paste_event_fields
  @on_paste_event_fields
end

#partner_codeObject

Returns the value of attribute partner_code.



15
16
17
# File 'lib/capital_on_tap/application.rb', line 15

def partner_code
  @partner_code
end

#personal_addressObject

Returns the value of attribute personal_address.



11
12
13
# File 'lib/capital_on_tap/application.rb', line 11

def personal_address
  @personal_address
end

#promo_codeObject

Returns the value of attribute promo_code.



14
15
16
# File 'lib/capital_on_tap/application.rb', line 14

def promo_code
  @promo_code
end

#registration_numberObject

Returns the value of attribute registration_number.



13
14
15
# File 'lib/capital_on_tap/application.rb', line 13

def registration_number
  @registration_number
end

#requested_creditObject

Returns the value of attribute requested_credit.



15
16
17
# File 'lib/capital_on_tap/application.rb', line 15

def requested_credit
  @requested_credit
end

#restricted_countriesObject

Returns the value of attribute restricted_countries.



15
16
17
# File 'lib/capital_on_tap/application.rb', line 15

def restricted_countries
  @restricted_countries
end

#salutationObject

Returns the value of attribute salutation.



9
10
11
# File 'lib/capital_on_tap/application.rb', line 9

def salutation
  @salutation
end

#trading_nameObject

Returns the value of attribute trading_name.



12
13
14
# File 'lib/capital_on_tap/application.rb', line 12

def trading_name
  @trading_name
end

#years_tradingObject

Returns the value of attribute years_trading.



12
13
14
# File 'lib/capital_on_tap/application.rb', line 12

def years_trading
  @years_trading
end

Class Method Details

.create(params) ⇒ Object

Create a new application with the given parameters Example JSON: {

"CustomerId": null,
"Salutation": "Mr",
"FirstName": "Amjed",
"MiddleName": "",
"LastName": "Ali",
"DateOfBirth": "1967-07-14T00:00:00+01:00",
"MobilePhone": "07841580124",
"HomePhone": null,
"EmailAddress": "[email protected]",
"MonthlyIncome": 5000,
"MonthlyExpenditure": 4000,
"PersonalAddress": {
  "Company": null,
  "BuildingName": "",
  "UnitNumber": "",
  "BuildingNumber": "244",
  "Street": "Grahams Road",
  "PostCode": "CH61 7XF",
  "City": "Wirral",
  "CountryCode": "UK",
  "Line1": "PostApplication",
  "Line2": null
},
"TradingName": "Glamour Bikinis And Clothing Boutique Limited",
"BusinessLegalName": "Glamour Bikinis And Clothing Boutique Limited",
"BusinessLandline": "07874186570",
"YearsTrading":8,
"MonthlyTurnOver":10000,
"BusinessType": "LimitedCompany",
"RegistrationNumber":10322035,
"BusinessAddress": {
  "Company": null,
  "BuildingName": "",
  "UnitNumber": "",
  "BuildingNumber": "102",
  "Street": "Ford Road",
  "PostCode": "CH49 0TQ",
  "City": "Wirral",
  "CountryCode": "UK",
  "Line1": "PostApplication",
  "Line2": null
},
"PromoCode": null,
"OnPasteEventFields": null,
"MonthlyBusinessExpenditure": null,
"GoogleSessionId": null,
"PartnerCode": null,
"ExternalReference": null,
"RestrictedCountries":false,
"RequestedCredit":10000,
"ApplicationGuid": null

}



104
105
106
# File 'lib/capital_on_tap/application.rb', line 104

def self.create(params)
  CapitalOnTap.connection.post('Applications', params)
end

.status(locator_id) ⇒ Object



108
109
110
# File 'lib/capital_on_tap/application.rb', line 108

def self.status(locator_id)
  CapitalOnTap.connection.get("Applications/#{locator_id}")
end