Class: CapitalOnTap::Application
- Inherits:
-
Object
- Object
- CapitalOnTap::Application
- 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
-
#business_address ⇒ Object
Returns the value of attribute business_address.
-
#business_land_line ⇒ Object
Returns the value of attribute business_land_line.
-
#business_legal_name ⇒ Object
Returns the value of attribute business_legal_name.
-
#business_type ⇒ Object
Returns the value of attribute business_type.
-
#customer_uses_personal_bank_account_for_business ⇒ Object
Returns the value of attribute customer_uses_personal_bank_account_for_business.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#external_reference ⇒ Object
Returns the value of attribute external_reference.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#home_phone ⇒ Object
Returns the value of attribute home_phone.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#mobile_phone ⇒ Object
Returns the value of attribute mobile_phone.
-
#monthly_expenditure ⇒ Object
Returns the value of attribute monthly_expenditure.
-
#monthly_income ⇒ Object
Returns the value of attribute monthly_income.
-
#monthly_turn_over ⇒ Object
Returns the value of attribute monthly_turn_over.
-
#montly_business_expenditure ⇒ Object
Returns the value of attribute montly_business_expenditure.
-
#on_paste_event_fields ⇒ Object
Returns the value of attribute on_paste_event_fields.
-
#partner_code ⇒ Object
Returns the value of attribute partner_code.
-
#personal_address ⇒ Object
Returns the value of attribute personal_address.
-
#promo_code ⇒ Object
Returns the value of attribute promo_code.
-
#registration_number ⇒ Object
Returns the value of attribute registration_number.
-
#requested_credit ⇒ Object
Returns the value of attribute requested_credit.
-
#restricted_countries ⇒ Object
Returns the value of attribute restricted_countries.
-
#salutation ⇒ Object
Returns the value of attribute salutation.
-
#trading_name ⇒ Object
Returns the value of attribute trading_name.
-
#years_trading ⇒ Object
Returns the value of attribute years_trading.
Class Method Summary collapse
-
.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 }.
- .status(locator_id) ⇒ Object
Instance Attribute Details
#business_address ⇒ Object
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_line ⇒ Object
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 |
#business_legal_name ⇒ Object
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_type ⇒ Object
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_business ⇒ Object
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 @customer_uses_personal_bank_account_for_business end |
#date_of_birth ⇒ Object
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_address ⇒ Object
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_reference ⇒ Object
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_name ⇒ Object
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_phone ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
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_phone ⇒ Object
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_expenditure ⇒ Object
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_income ⇒ Object
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_over ⇒ Object
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_expenditure ⇒ Object
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_fields ⇒ Object
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_code ⇒ Object
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_address ⇒ Object
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_code ⇒ Object
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_number ⇒ Object
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_credit ⇒ Object
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_countries ⇒ Object
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 |
#salutation ⇒ Object
Returns the value of attribute salutation.
9 10 11 |
# File 'lib/capital_on_tap/application.rb', line 9 def salutation @salutation end |
#trading_name ⇒ Object
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_trading ⇒ Object
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 |