Class: Braintree::Customer

### Home Classes Methods

### In Files

- lib/braintree/customer.rb

### Parent

Object

### Methods

- ::all
- ::create
- ::create!
- ::create_customer_url
- ::create_from_transparent_redirect
- ::credit
- ::credit!
- ::delete
- ::find
- ::sale
- ::sale!
- ::search
- ::transactions
- ::update
- ::update!
- ::update_customer_url
- ::update_from_transparent_redirect
- #==
- #credit
- #credit!
- #delete
- #sale
- #sale!
- #transactions
- #update
- #update!

### Class/Module Index

Quicksearch

- Braintree
- Braintree::AddOn
- Braintree::AddOnGateway
- Braintree::Address
- Braintree::AddressGateway
- Braintree::AdvancedSearch
- Braintree::AdvancedSearch::MultipleValueOrTextNode
- Braintree::AuthenticationError
- Braintree::AuthorizationError
- Braintree::BraintreeError
- Braintree::Configuration
- Braintree::ConfigurationError
- Braintree::CreditCard
- Braintree::CreditCard::CardType
- Braintree::CreditCard::CustomerLocation
- Braintree::CreditCardVerification
- Braintree::CreditCardVerification::Status
- Braintree::Customer
- Braintree::Discount
- Braintree::DiscountGateway
- Braintree::DownForMaintenanceError
- Braintree::ErrorCodes
- Braintree::ErrorCodes::Address
- Braintree::ErrorCodes::CreditCard
- Braintree::ErrorCodes::CreditCard::Options
- Braintree::ErrorCodes::Customer
- Braintree::ErrorCodes::Descriptor
- Braintree::ErrorCodes::SettlementBatchSummary
- Braintree::ErrorCodes::Subscription
- Braintree::ErrorCodes::Subscription::Modification
- Braintree::ErrorCodes::Transaction
- Braintree::ErrorCodes::Transaction::Options
- Braintree::ErrorResult
- Braintree::Errors
- Braintree::ForgedQueryString
- Braintree::NotFoundError
- Braintree::Plan
- Braintree::SSLCertificateError
- Braintree::ServerError
- Braintree::SettlementBatchSummary
- Braintree::SettlementBatchSummaryGateway
- Braintree::Subscription
- Braintree::Subscription::Status
- Braintree::Subscription::TrialDurationUnit
- Braintree::SuccessfulResult
- Braintree::Test
- Braintree::Test::CreditCardNumbers
- Braintree::Test::CreditCardNumbers::FailsSandboxVerification
- Braintree::Test::TransactionAmounts
- Braintree::Transaction
- Braintree::Transaction::CreatedUsing
- Braintree::Transaction::GatewayRejectionReason
- Braintree::Transaction::Source
- Braintree::Transaction::Status
- Braintree::TransparentRedirect
- Braintree::TransparentRedirectGateway
- Braintree::UnexpectedError
- Braintree::UpgradeRequiredError
- Braintree::ValidationError
- Braintree::ValidationErrorCollection
- Braintree::ValidationsFailed
- Braintree::Version

No matching classes.

# Braintree::Customer

See www.braintreepayments.com/docs/ruby

### Attributes

addresses[R]
company[R]
created_at[R]
credit_cards[R]
custom_fields[R]
email[R]
fax[R]
first_name[R]
id[R]
last_name[R]
phone[R]
updated_at[R]
website[R]

### Public Class Methods

all() click to toggle source

See www.braintreepayments.com/docs/ruby/customers/search

    # File lib/braintree/customer.rb, line 10
    def self.all
      Configuration.gateway.customer.all
    end

create(attributes = {}) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/create

    # File lib/braintree/customer.rb, line 15
    def self.create(attributes = {})
      Configuration.gateway.customer.create(attributes)
    end

create!(attributes = {}) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/create

    # File lib/braintree/customer.rb, line 20
    def self.create!(attributes = {})
      return_object_or_raise(:customer) { create(attributes) }
    end

create_customer_url() click to toggle source

Deprecated. Use Braintree::TransparentRedirect.url

See www.braintreepayments.com/docs/ruby/customers/create_tr

    # File lib/braintree/customer.rb, line 27
    def self.create_customer_url
      warn "[DEPRECATED] Customer.create_customer_url is deprecated. Please use TransparentRedirect.url"
      Configuration.gateway.customer.create_customer_url
    end

create_from_transparent_redirect(query_string) click to toggle source

Deprecated. Use Braintree::TransparentRedirect.confirm

See www.braintreepayments.com/docs/ruby/customers/create_tr

    # File lib/braintree/customer.rb, line 35
    def self.create_from_transparent_redirect(query_string)
      warn "[DEPRECATED] Customer.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
      Configuration.gateway.customer.create_from_transparent_redirect(query_string)
    end

credit(customer_id, transaction_attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 41
    def self.credit(customer_id, transaction_attributes)
      Transaction.credit(transaction_attributes.merge(:customer_id => customer_id))
    end

credit!(customer_id, transaction_attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 46
    def self.credit!(customer_id, transaction_attributes)
       return_object_or_raise(:transaction){ credit(customer_id, transaction_attributes) }
    end

delete(customer_id) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/delete

    # File lib/braintree/customer.rb, line 51
    def self.delete(customer_id)
      Configuration.gateway.customer.delete(customer_id)
    end

find(customer_id) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/search

    # File lib/braintree/customer.rb, line 56
    def self.find(customer_id)
      Configuration.gateway.customer.find(customer_id)
    end

sale(customer_id, transaction_attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 61
    def self.sale(customer_id, transaction_attributes)
      Transaction.sale(transaction_attributes.merge(:customer_id => customer_id))
    end

sale!(customer_id, transaction_attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 66
    def self.sale!(customer_id, transaction_attributes)
      return_object_or_raise(:transaction) { sale(customer_id, transaction_attributes) }
    end

search(&block) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/search

    # File lib/braintree/customer.rb, line 71
    def self.search(&block)
      Configuration.gateway.customer.search(&block)
    end

transactions(customer_id, options = {}) click to toggle source

Returns a ResourceCollection of transactions for the customer with the given `customer_id`.

    # File lib/braintree/customer.rb, line 76
    def self.transactions(customer_id, options = {})
      Configuration.gateway.customer.transactions(customer_id, options = {})
    end

update(customer_id, attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/update

    # File lib/braintree/customer.rb, line 81
    def self.update(customer_id, attributes)
      Configuration.gateway.customer.update(customer_id, attributes)
    end

update!(customer_id, attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/customers/update

    # File lib/braintree/customer.rb, line 86
    def self.update!(customer_id, attributes)
      return_object_or_raise(:customer) { update(customer_id, attributes) }
    end

update_customer_url() click to toggle source

Deprecated. Use Braintree::TransparentRedirect.url

See www.braintreepayments.com/docs/ruby/customers/update_tr

    # File lib/braintree/customer.rb, line 93
    def self.update_customer_url
      warn "[DEPRECATED] Customer.update_customer_url is deprecated. Please use TransparentRedirect.url"
      Configuration.gateway.customer.update_customer_url
    end

update_from_transparent_redirect(query_string) click to toggle source

Deprecated. Use Braintree::TransparentRedirect.confirm

See www.braintreepayments.com/docs/ruby/customers/update_tr

    # File lib/braintree/customer.rb, line 101
    def self.update_from_transparent_redirect(query_string)
      warn "[DEPRECATED] Customer.update_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
      Configuration.gateway.customer.update_from_transparent_redirect(query_string)
    end

### Public Instance Methods

==(other) click to toggle source

Returns true if `other` is a Customer with the same id

    # File lib/braintree/customer.rb, line 181
    def ==(other)
      return false unless other.is_a?(Customer)
      id == other.id
    end

credit(transaction_attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 115
    def credit(transaction_attributes)
      @gateway.transaction.credit(transaction_attributes.merge(:customer_id => id))
    end

credit!(transaction_attributes) click to toggle source

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 120
    def credit!(transaction_attributes)
      return_object_or_raise(:transaction) { credit(transaction_attributes) }
    end

delete() click to toggle source

See www.braintreepayments.com/docs/ruby/customers/delete

    # File lib/braintree/customer.rb, line 125
    def delete
      @gateway.customer.delete(id)
    end

sale(transaction_attributes) click to toggle source

Deprecated. Use Braintree::Customer.sale

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 142
    def sale(transaction_attributes)
      warn "[DEPRECATED] sale as an instance method is deprecated. Please use Customer.sale"
      @gateway.transaction.sale(transaction_attributes.merge(:customer_id => id))
    end

sale!(transaction_attributes) click to toggle source

Deprecated. Use Braintree::Customer.sale!

See www.braintreepayments.com/docs/ruby/transactions/create_from_vault

    # File lib/braintree/customer.rb, line 150
    def sale!(transaction_attributes)
      warn "[DEPRECATED] sale! as an instance method is deprecated. Please use Customer.sale!"
      return_object_or_raise(:transaction) { sale(transaction_attributes) }
    end

transactions(options = {}) click to toggle source

Returns a ResourceCollection of transactions for the customer.

    # File lib/braintree/customer.rb, line 156
    def transactions(options = {})
      @gateway.customer.transactions(id, options)
    end

update(attributes) click to toggle source

Deprecated. Use Braintree::Customer.update

See www.braintreepayments.com/docs/ruby/customers/update

    # File lib/braintree/customer.rb, line 163
    def update(attributes)
      warn "[DEPRECATED] update as an instance method is deprecated. Please use Customer.update"
      result = @gateway.customer.update(id, attributes)
      if result.success?
        copy_instance_variables_from_object result.customer
      end
      result
    end

update!(attributes) click to toggle source

Deprecated. Use Braintree::Customer.update!

See www.braintreepayments.com/docs/ruby/customers/update

    # File lib/braintree/customer.rb, line 175
    def update!(attributes)
      warn "[DEPRECATED] update! as an instance method is deprecated. Please use Customer.update!"
      return_object_or_raise(:customer) { update(attributes) }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.