capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 75 forks source link

Prevent user from removing the last credit card #218

Closed Prakort closed 1 year ago

Prakort commented 1 year ago

Is your feature request related to a problem? Please describe. User can remove all credit cards from the payment flow and the default payment method is detached from the user (Stripe customer). Is this intended feature?

Describe the solution you'd like I would like to have an optional parameter to restrict user from removing the last credit card in the payment flow.

dalanmiller commented 1 year ago

I would like to have an optional parameter to restrict user from removing the last credit card in the payment flow.

What is the thinking around obliging them to keep a single payment method? What if that payment method is also expired?

Prakort commented 1 year ago

@dalanmiller

What is the thinking around obliging them to keep a single payment method? My thought process that I want something similar to the demo for the customer management https://stripe.com/docs/customer-management where the user cannot remove a payment method when there is an active subscription.

What if that payment method is also expired? It definitely needs to be handled by the server when the payment fails. I could see that when the user removes all cards, it has to be handled by the server too.