spree/spree_gateway — pull request #190 by plongyear (2014-12-05 22:12:09+00:00)
Title: Use credit card tokens over customer profile ids

In the Braintree gateway, ```authorize``` passes the customer profile id to Braintree. If the customer has multiple credit cards stored in Braintree, the one that is marked as default in Braintree will be selected regardless of which credit card the user actually selected in Spree.

Passing the credit card's payment token should fix this issue. I still left in the use of the customer profile id as the payment method if the credit card's token doesn't exist, but I think it may be better to just remove the use of that altogether and default to the credit card instance itself if ```creditcard.gateway_payment_profile_id``` is not present. Any thoughts on this?

I also just want to note that this requires version 1.44 of activemerchant to work. That is when the ```payment_method_token``` option was introduced. It seems like most versions of Spree are on 1.44.1 now so I think this should be fine.