flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

Payment Method Id not saving on stripe

Open WilliamAtBSL opened this issue 3 years ago • 1 comments

Describe the bug presentPaymentSheet card selection doesn't record the selected payment method id in the stripe backend.

To Reproduce Steps to reproduce the behavior:

  1. Call paymentIntent api
  2. pass the necessary information into SetupPaymentSheetParaments for stripe initPaymentSheet
  3. Await for stripe presentPaymentSheet
  4. select an available card.
  5. check payment in stripe development
  6. status is still waiting for payment method.

Expected behavior I expect at this stage of selecting a credit card it suppose to be logged in the stripe api with the selected payment method. If I were to call the confirmPaymentSheetPayment, it saves the payment method id but it also processes the payment which is not what I want.

Smartphone / tablet

  • Samsung S9+
  • Android 10
  • Flutter Stripe 5.1.0
  • Flutter version 3.3.4

Additional context code being used await stripe.initPaymentSheet( paymentSheetParameters: SetupPaymentSheetParameters( customFlow: true, allowsDelayedPaymentMethods: true, merchantDisplayName: 'Business Name', setupIntentClientSecret: _checkoutRequest?.clientSecret, customerEphemeralKeySecret: _checkoutRequest?.ephemeralKey, customerId: _checkoutRequest?.customerId, ), ); await stripe.presentPaymentSheet();

WilliamAtBSL avatar Oct 12 '22 06:10 WilliamAtBSL

If what you need is to store the payment information and not process the payment directly. You should be using the SetupIntents api: https://stripe.com/docs/payments/setup-intents

With the PaymentIntent the payment Method id is registered when the payment is processed

jamesblasco avatar Oct 14 '22 10:10 jamesblasco