Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Add method to delete card #281

Closed
vlakoff opened this issue Mar 5, 2016 · 13 comments
Closed

[Request] Add method to delete card #281

vlakoff opened this issue Mar 5, 2016 · 13 comments

Comments

@vlakoff
Copy link

vlakoff commented Mar 5, 2016

Please, could you consider adding to the Billable class a deleteCard method?

Nowadays it is possible to delete all cards of a given customer, see this blog post and the relevant API.

I'm being frustrated by the amount of websites based on Stripe that don't let deleting the card, despite this being such a fundamental requirement IMO.

You can have an influence on this, just by adding this class method. Thank you in advance.

@themsaid
Copy link
Member

PR created #357

@realripley00
Copy link

realripley00 commented Apr 26, 2017

I wasn't able to get this to work with deleteCard(). I looked at the cashier git and apparently the method is actually deleteCards(). Now it's working great. So if you're having trouble getting this to work try deleteCards() with an s instead of deleteCard().

@vlakoff
Copy link
Author

vlakoff commented Apr 26, 2017

Thanks for pointing this out. Indeed, Taylor renamed the method from deleteCard() to deleteCards() in a subsequent commit.

@WR4F
Copy link

WR4F commented Dec 13, 2018

EDIT: Please refer to the new documentation for Laravel 6, https://laravel.com/docs/6.x/billing#deleting-payment-methods, my comment is referring to an old version of documentation

There is currently no mention of the deleteCards() method, nor any way to delete customers from Stripe's/Braintree's in the docs (https://laravel.com/docs/5.7/billing).

@themsaid, can this be added?

@tallcoder
Copy link

I don't feel like this should be closed. While, yes, there's a method for deleting all cards. There's no method for deleting a specific card.

@driesvints
Copy link
Member

@tallcoder yes there is: https://laravel.com/docs/6.x/billing#deleting-payment-methods

@driesvints
Copy link
Member

You also have removePaymentMethod on the billable entity

@sazibuddin
Copy link

deletePaymentMethods() is deleting all the cards from stripe.
So I want to delete a specific card from many cards. How it can be?

I see there have $paymentMethod->delete(); function. what it expect as $paymentMethod here ?

@driesvints
Copy link
Member

@sazibuddin you can delete a specific payment method with:

$user->removePaymentMethod($id);

@sazibuddin
Copy link

@driesvints, Thanks for your reply. But I struggle that what the function expects as an id?
Can you please tell me about that?

@driesvints
Copy link
Member

The payment method ID or a payment method object.

@sazibuddin
Copy link

@driesvints, I just tried and it works like a champ. Thank you very much. you make my day.

@driesvints
Copy link
Member

I saw this wasn't documented yet so I sent in a PR for it to the docs: laravel/docs#7559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants