Cashier-stripe: Billable->updateCard doesn't delete old card

Created on 5 Mar 2016  路  6Comments  路  Source: laravel/cashier-stripe

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:

  • addCard
  • removeCard
  • cards
  • setDefaultCard
enhancement

Most helpful comment

I'll send in a PR to the docs for this.

All 6 comments

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:

  • addCard --> updateCard on Billable
  • removeCard --> delete on Card
  • cards --> on Billable
  • setDefaultCard --> updateCard on Billable

I 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

borutjures picture borutjures  路  3Comments

tania-pets picture tania-pets  路  3Comments

MarGul picture MarGul  路  5Comments

jessehorne picture jessehorne  路  3Comments

driesvints picture driesvints  路  3Comments