flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
929 stars 514 forks source link

I need to clear the card data after payment method creation #590

Closed amani-flutter closed 2 years ago

amani-flutter commented 2 years ago

Is your feature request related to a problem? (please describe) Yea, I face a problem that the card data I entered for payment is saved and I can't delete it. So the next time I use Stripe terminal, it reads the already saved data and this is not what we want.

Describe the solution you'd like I need a way to clear the card data once the payment method is created so it is not saved on Stripe anymore.

Describe alternatives you've considered I am not sure what else can be done. But I used PaymentIntentsFutureUsage.OffSession parameter for setupFutureUsage value and the problem still happens.

Additional context No more context.

jonasbark commented 2 years ago

Hi there,

typically Flutter Stripe should be used to collect payment information, such as credit card. It's the responsibility of your backend to provide the ability to manage (update, remove) existing payment methods. I'm not exactly sure what you intend to do and what the connection to Stripe Terminal is.

amani-flutter commented 2 years ago

@jonasbark I am using this Stripe device https://stripe.com/docs/terminal/readers/bbpos-chipper2xbt to process payments along with the manual entry.

After entering the card data and creating the payment method in the app, when I try to process the payment using this device it uses the same card data saved in Stripe and I can't use the new card data to process the payment - since the card in this case is external not entered manually -.

I want to know how can I clear the card data after payment method creation to allow the Stripe device to collect payment using the new card data instead of the saved one.

remonh87 commented 2 years ago

@amani-flutter what Jonas meant is that your backend should handle this case. I think the existing PaymentIntent should be cancelled and it should provide a new one to our client.

The scope of this library is about collecting payment details from the customer.I would suggest to contact Stripe support on this matter they have a lot of knowledge about how to handle this from backend perspective.

mohadel92 commented 11 months ago

@amani-flutter what Jonas meant is that your backend should handle this case. I think the existing PaymentIntent should be cancelled and it should provide a new one to our client.

The scope of this library is about collecting payment details from the customer.I would suggest to contact Stripe support on this matter they have a lot of knowledge about how to handle this from backend perspective.

@remonh87 i want to save my payment method and to retrieve the saved card can i do so with the flutter_stripe package or shall i do it in another way?