def store(creditcard, options = {})
commit do
result = Braintree::Customer.create(
:first_name => creditcard.first_name,
:last_name => creditcard.last_name,
:email => options[:email],
:credit_card => {
:number => creditcard.number,
:cvv => creditcard.verification_value,
:expiration_month => creditcard.month.to_s.rjust(2, "0"),
:expiration_year => creditcard.year.to_s
}
)
Response.new(result.success?, message_from_result(result),
{
:braintree_customer => (customer_hash(result.customer) if result.success?),
:customer_vault_id => (result.customer.id if result.success?)
}
)
end
end