For more detailed documentation on Customers, see www.braintreepaymentsolutions.com/gateway/customer-api
| [R] | addresses | |
| [R] | company | |
| [R] | created_at | |
| [R] | credit_cards | |
| [R] | custom_fields | |
| [R] | ||
| [R] | fax | |
| [R] | first_name | |
| [R] | id | |
| [R] | last_name | |
| [R] | phone | |
| [R] | updated_at | |
| [R] | website |
Returns a ResourceCollection of all customers stored in the vault.
customers = Braintree::Customer.all
customers.each do |customer|
puts "Customer #{customer.id} email is #{customer.email}"
end
Creates a customer using the given attributes. If :id is not passed, the gateway will generate it.
result = Braintree::Customer.create(
:first_name => "John",
:last_name => "Smith",
:company => "Smith Co.",
:email => "john@smith.com",
:website => "www.smithco.com",
:fax => "419-555-1234",
:phone => "614-555-1234"
)
if result.success?
puts "Created customer #{result.customer.id}
else
puts "Could not create customer, see result.errors"
end
Returns a ResourceCollection of transactions for the customer with the given customer_id.
Returns a ResourceCollection of transactions for the customer.