Class: MoneyMover::Dwolla::Customer
- Inherits:
-
ApiResource
- Object
- ApiResource
- MoneyMover::Dwolla::Customer
- Defined in:
- lib/money_mover/dwolla/models/customer.rb
Direct Known Subclasses
ReceiveOnlyCustomer, UnverifiedBusinessCustomer, UnverifiedCustomer, VerifiedBusinessCustomer
Constant Summary collapse
- COMPANY_TYPES =
%w( soleproprietorship llc partnership corporation )
Instance Attribute Summary collapse
-
#address1 ⇒ Object
Returns the value of attribute address1.
-
#address2 ⇒ Object
Returns the value of attribute address2.
-
#businessClassification ⇒ Object
Returns the value of attribute businessClassification.
-
#businessName ⇒ Object
Returns the value of attribute businessName.
-
#businessType ⇒ Object
Returns the value of attribute businessType.
-
#city ⇒ Object
Returns the value of attribute city.
-
#created ⇒ Object
Returns the value of attribute created.
-
#dateOfBirth ⇒ Object
Returns the value of attribute dateOfBirth.
-
#doingBusinessAs ⇒ Object
Returns the value of attribute doingBusinessAs.
-
#ein ⇒ Object
Returns the value of attribute ein.
-
#email ⇒ Object
Returns the value of attribute email.
-
#firstName ⇒ Object
Returns the value of attribute firstName.
-
#ipAddress ⇒ Object
Returns the value of attribute ipAddress.
-
#lastName ⇒ Object
Returns the value of attribute lastName.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#postalCode ⇒ Object
Returns the value of attribute postalCode.
-
#ssn ⇒ Object
Returns the value of attribute ssn.
-
#state ⇒ Object
Returns the value of attribute state.
-
#status ⇒ Object
Returns the value of attribute status.
-
#type ⇒ Object
Returns the value of attribute type.
-
#website ⇒ Object
Returns the value of attribute website.
Attributes inherited from ApiResource
#_embedded, #_links, #attrs, #id, #resource_location
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ApiResource
Constructor Details
This class inherits a constructor from MoneyMover::Dwolla::ApiResource
Instance Attribute Details
#address1 ⇒ Object
Returns the value of attribute address1.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def address1 @address1 end |
#address2 ⇒ Object
Returns the value of attribute address2.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def address2 @address2 end |
#businessClassification ⇒ Object
Returns the value of attribute businessClassification.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def businessClassification @businessClassification end |
#businessName ⇒ Object
Returns the value of attribute businessName.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def businessName @businessName end |
#businessType ⇒ Object
Returns the value of attribute businessType.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def businessType @businessType end |
#city ⇒ Object
Returns the value of attribute city.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def city @city end |
#created ⇒ Object
Returns the value of attribute created.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def created @created end |
#dateOfBirth ⇒ Object
Returns the value of attribute dateOfBirth.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def dateOfBirth @dateOfBirth end |
#doingBusinessAs ⇒ Object
Returns the value of attribute doingBusinessAs.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def doingBusinessAs @doingBusinessAs end |
#ein ⇒ Object
Returns the value of attribute ein.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def ein @ein end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def email @email end |
#firstName ⇒ Object
Returns the value of attribute firstName.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def firstName @firstName end |
#ipAddress ⇒ Object
Returns the value of attribute ipAddress.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def ipAddress @ipAddress end |
#lastName ⇒ Object
Returns the value of attribute lastName.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def lastName @lastName end |
#phone ⇒ Object
Returns the value of attribute phone.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def phone @phone end |
#postalCode ⇒ Object
Returns the value of attribute postalCode.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def postalCode @postalCode end |
#ssn ⇒ Object
Returns the value of attribute ssn.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def ssn @ssn end |
#state ⇒ Object
Returns the value of attribute state.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def state @state end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def status @status end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def type @type end |
#website ⇒ Object
Returns the value of attribute website.
6 7 8 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 6 def website @website end |
Class Method Details
.find(id) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 28 def self.find(id) client = ApplicationClient.new response = client.get fetch_endpoint(id) if response.success? new response.body else raise 'Customer Not Found' #puts "error: #{response.body}" end end |
Instance Method Details
#save ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/money_mover/dwolla/models/customer.rb', line 41 def save return false unless valid? if @id response = @client.post self.class.fetch_endpoint(@id), create_params add_errors_from response unless response.success? else response = @client.post create_endpoint, create_params if response.success? @resource_location = response.resource_location @id = response.resource_id else add_errors_from response end end errors.empty? end |