Class: Apruve::CorporateAccount
- Inherits:
-
ApruveObject
- Object
- ApruveObject
- Apruve::CorporateAccount
- Defined in:
- lib/apruve/resources/corporate_account.rb
Instance Attribute Summary collapse
-
#authorized_buyers ⇒ Object
Returns the value of attribute authorized_buyers.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#credit_amount_cents ⇒ Object
Returns the value of attribute credit_amount_cents.
-
#credit_available_cents ⇒ Object
Returns the value of attribute credit_available_cents.
-
#credit_balance_cents ⇒ Object
Returns the value of attribute credit_balance_cents.
-
#creditor_term_id ⇒ Object
Returns the value of attribute creditor_term_id.
-
#customer_uuid ⇒ Object
Returns the value of attribute customer_uuid.
-
#disabled_at ⇒ Object
Returns the value of attribute disabled_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#merchant_uuid ⇒ Object
Returns the value of attribute merchant_uuid.
-
#name ⇒ Object
Returns the value of attribute name.
-
#payment_method_id ⇒ Object
Returns the value of attribute payment_method_id.
-
#payment_term_strategy_name ⇒ Object
Returns the value of attribute payment_term_strategy_name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#trusted_merchant ⇒ Object
Returns the value of attribute trusted_merchant.
-
#type ⇒ Object
Returns the value of attribute type.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
- .find(merchant_id, email = nil) ⇒ Object
- .find_all(merchant_id) ⇒ Object
- .find_by_uuid(merchant_id, uuid) ⇒ Object
Methods inherited from ApruveObject
#initialize, logger, #logger, #to_hash, #to_json, #validate
Constructor Details
This class inherits a constructor from Apruve::ApruveObject
Instance Attribute Details
#authorized_buyers ⇒ Object
Returns the value of attribute authorized_buyers.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def @authorized_buyers end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def created_at @created_at end |
#credit_amount_cents ⇒ Object
Returns the value of attribute credit_amount_cents.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def credit_amount_cents @credit_amount_cents end |
#credit_available_cents ⇒ Object
Returns the value of attribute credit_available_cents.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def credit_available_cents @credit_available_cents end |
#credit_balance_cents ⇒ Object
Returns the value of attribute credit_balance_cents.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def credit_balance_cents @credit_balance_cents end |
#creditor_term_id ⇒ Object
Returns the value of attribute creditor_term_id.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def creditor_term_id @creditor_term_id end |
#customer_uuid ⇒ Object
Returns the value of attribute customer_uuid.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def customer_uuid @customer_uuid end |
#disabled_at ⇒ Object
Returns the value of attribute disabled_at.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def disabled_at @disabled_at end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def id @id end |
#merchant_uuid ⇒ Object
Returns the value of attribute merchant_uuid.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def merchant_uuid @merchant_uuid end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def name @name end |
#payment_method_id ⇒ Object
Returns the value of attribute payment_method_id.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def payment_method_id @payment_method_id end |
#payment_term_strategy_name ⇒ Object
Returns the value of attribute payment_term_strategy_name.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def payment_term_strategy_name @payment_term_strategy_name end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def status @status end |
#trusted_merchant ⇒ Object
Returns the value of attribute trusted_merchant.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def trusted_merchant @trusted_merchant end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def type @type end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/apruve/resources/corporate_account.rb', line 3 def updated_at @updated_at end |
Class Method Details
.find(merchant_id, email = nil) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/apruve/resources/corporate_account.rb', line 7 def self.find(merchant_id, email=nil) if email.nil? return find_all(merchant_id) end email = CGI::escape(email) response = Apruve.get("merchants/#{merchant_id}/corporate_accounts?email=#{email}") CorporateAccount.new(response.body.empty? ? {} : response.body[0]) end |
.find_all(merchant_id) ⇒ Object
16 17 18 19 |
# File 'lib/apruve/resources/corporate_account.rb', line 16 def self.find_all(merchant_id) response = Apruve.get("merchants/#{merchant_id}/corporate_accounts") response.body.map { |ca| CorporateAccount.new(ca.empty? ? {} : ca) } end |
.find_by_uuid(merchant_id, uuid) ⇒ Object
21 22 23 24 |
# File 'lib/apruve/resources/corporate_account.rb', line 21 def self.find_by_uuid(merchant_id, uuid) response = Apruve.get("merchants/#{merchant_id}/corporate_accounts/#{uuid}") CorporateAccount.new response.body end |