Class: Braintree::MerchantAccount
- Inherits:
-
Object
- Object
- Braintree::MerchantAccount
- Includes:
- BaseModule
- Defined in:
- lib/braintree/merchant_account.rb,
lib/braintree/merchant_account/address_details.rb,
lib/braintree/merchant_account/funding_details.rb,
lib/braintree/merchant_account/business_details.rb,
lib/braintree/merchant_account/individual_details.rb
Defined Under Namespace
Modules: FundingDestination, FundingDestinations, Status Classes: AddressDetails, BusinessDetails, FundingDetails, IndividualDetails
Instance Attribute Summary collapse
-
#business_details ⇒ Object
readonly
Returns the value of attribute business_details.
-
#currency_iso_code ⇒ Object
readonly
Returns the value of attribute currency_iso_code.
-
#default ⇒ Object
(also: #default?)
readonly
Returns the value of attribute default.
-
#funding_details ⇒ Object
readonly
Returns the value of attribute funding_details.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#individual_details ⇒ Object
readonly
Returns the value of attribute individual_details.
-
#master_merchant_account ⇒ Object
readonly
Returns the value of attribute master_merchant_account.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
- ._new(*args) ⇒ Object
- .create(*args) ⇒ Object
- .create!(*args) ⇒ Object
- .find(*args) ⇒ Object
- .update(*args) ⇒ Object
- .update!(*args) ⇒ Object
Instance Method Summary collapse
-
#initialize(gateway, attributes) ⇒ MerchantAccount
constructor
A new instance of MerchantAccount.
- #inspect ⇒ Object
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(gateway, attributes) ⇒ MerchantAccount
Returns a new instance of MerchantAccount.
52 53 54 55 56 57 58 59 |
# File 'lib/braintree/merchant_account.rb', line 52 def initialize(gateway, attributes) @gateway = gateway set_instance_variables_from_hash(attributes) @individual_details = IndividualDetails.new(@individual) @business_details = BusinessDetails.new(@business) @funding_details = FundingDetails.new(@funding) @master_merchant_account = MerchantAccount._new(@gateway, attributes.delete(:master_merchant_account)) if attributes[:master_merchant_account] end |
Instance Attribute Details
#business_details ⇒ Object (readonly)
Returns the value of attribute business_details.
21 22 23 |
# File 'lib/braintree/merchant_account.rb', line 21 def business_details @business_details end |
#currency_iso_code ⇒ Object (readonly)
Returns the value of attribute currency_iso_code.
22 23 24 |
# File 'lib/braintree/merchant_account.rb', line 22 def currency_iso_code @currency_iso_code end |
#default ⇒ Object (readonly) Also known as: default?
Returns the value of attribute default.
23 24 25 |
# File 'lib/braintree/merchant_account.rb', line 23 def default @default end |
#funding_details ⇒ Object (readonly)
Returns the value of attribute funding_details.
24 25 26 |
# File 'lib/braintree/merchant_account.rb', line 24 def funding_details @funding_details end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
25 26 27 |
# File 'lib/braintree/merchant_account.rb', line 25 def id @id end |
#individual_details ⇒ Object (readonly)
Returns the value of attribute individual_details.
26 27 28 |
# File 'lib/braintree/merchant_account.rb', line 26 def individual_details @individual_details end |
#master_merchant_account ⇒ Object (readonly)
Returns the value of attribute master_merchant_account.
27 28 29 |
# File 'lib/braintree/merchant_account.rb', line 27 def master_merchant_account @master_merchant_account end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
28 29 30 |
# File 'lib/braintree/merchant_account.rb', line 28 def status @status end |
Class Method Details
._new(*args) ⇒ Object
63 64 65 |
# File 'lib/braintree/merchant_account.rb', line 63 def _new(*args) self.new(*args) end |
.create(*args) ⇒ Object
32 33 34 |
# File 'lib/braintree/merchant_account.rb', line 32 def self.create(*args) Configuration.gateway.merchant_account.create(*args) end |
.create!(*args) ⇒ Object
36 37 38 |
# File 'lib/braintree/merchant_account.rb', line 36 def self.create!(*args) Configuration.gateway.merchant_account.create!(*args) end |
.find(*args) ⇒ Object
40 41 42 |
# File 'lib/braintree/merchant_account.rb', line 40 def self.find(*args) Configuration.gateway.merchant_account.find(*args) end |
.update(*args) ⇒ Object
44 45 46 |
# File 'lib/braintree/merchant_account.rb', line 44 def self.update(*args) Configuration.gateway.merchant_account.update(*args) end |
.update!(*args) ⇒ Object
48 49 50 |
# File 'lib/braintree/merchant_account.rb', line 48 def self.update!(*args) Configuration.gateway.merchant_account.update!(*args) end |
Instance Method Details
#inspect ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/braintree/merchant_account.rb', line 68 def inspect order = [:id, :status, :master_merchant_account] nice_attributes = order.map do |attr| "#{attr}: #{send(attr).inspect}" end "#<#{self.class}: #{nice_attributes.join(', ')}>" end |