class Apruve::CorporateAccount

Attributes

authorized_buyers[RW]
created_at[RW]
credit_amount_cents[RW]
credit_available_cents[RW]
credit_balance_cents[RW]
creditor_term_id[RW]
customer_uuid[RW]
disabled_at[RW]
id[RW]
merchant_uuid[RW]
name[RW]
payment_method_id[RW]
payment_term_strategy_name[RW]
status[RW]
trusted_merchant[RW]
type[RW]
updated_at[RW]

Public Class Methods

find(merchant_id, email=nil) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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