Object
See www.braintreepayments.com/docs/ruby/customers/search
# File lib/braintree/customer.rb, line 10 def self.all Configuration.gateway.customer.all end
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
See www.braintreepayments.com/docs/ruby/customers/delete
# File lib/braintree/customer.rb, line 125 def delete @gateway.customer.delete(id) end
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
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
Returns a ResourceCollection of transactions for the customer.
# File lib/braintree/customer.rb, line 156 def transactions(options = {}) @gateway.customer.transactions(id, options) end
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
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
Generated with the Darkfish Rdoc Generator 2.