When calling updateCard, it correctly adds the new token to the object's attached Stripe customer (and sets it as default).
However, it doesn't delete the old card on the Stripe customer. This results in many cards that Cashier doesn't know exist, because it only has a reference to the newest card in card_brand / card_last_four.
This is unexpected behavior for updateCard.
This could be implemented together with deleteCard (as requested in #281).
In the future, there could be a need for Cashier to support multiple cards, but it would deprecate updateCard, and instead introduce methods like:
This would be great +1
@eliassorensen - if you are still looking for this functionality, I have implemented it at:
https://github.com/coderity/wallet
It extends Cashier and adds additional methods - almost exactly as you specified above.
Atm all of this functionality is already available:
updateCard on Billabledelete on CardBillableupdateCard on BillableI would be helpful for people looking for a way to delete cards to know that the method for that is deleteCards(), for example:
$user->deleteCards()
removes a card from a user in both the database and on their Stripe customer (not sure about braintree).
I'd like to reference my request for documentation over on issue #281, it seems relevant and I found both of these issue threads searching for a way to do it myself.
I'll send in a PR to the docs for this.
Here it is: https://github.com/laravel/docs/pull/4854
Most helpful comment
I'll send in a PR to the docs for this.