flutter-stripe / flutter_stripe

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

Invalid argument(s): `automatic_async` is not one of the supported values: automatic, manual #1732

Open Kaskyi opened 4 months ago

Kaskyi commented 4 months ago

Describe the bug

ncaught (in promise) Error: Invalid argument(s): `automatic_async` is not one of the supported values: automatic, manual
    at Object.throw_ [as throw] (errors.dart:297:3)
    at Object.$36enumDecodeNullable [as $enumDecodeNullable] (enum_helpers.dart:37:5)
    at Object._$36$36PaymentIntentImplFromJson [as _$$PaymentIntentImplFromJson] (payment_intent.g.dart:32:22)
    at _$36PaymentIntentImpl.fromJson (payment_intent.freezed.dart:892:7)
    at Object._$36PaymentIntentFromJson [as _$PaymentIntentFromJson] (payment_intent.freezed.dart:18:25)

To Reproduce Steps to reproduce the behavior:

   await Stripe.instance.confirmPayment(
        paymentIntentClientSecret: paymentIntent['client_secret'],
        data: PaymentMethodParams.card(
          paymentMethodData: PaymentMethodData(
            billingDetails: billingDetails,
          ),
        ),
        options: const PaymentMethodOptions(
          setupFutureUsage: PaymentIntentsFutureUsage.OnSession,
        ),
      );

Expected behavior Dont have error.

Smartphone / tablet

Additional context #1608

tyukesz commented 4 months ago

Faced the same issue. Looks like the PaymentIntentCaptureMethod enum is missing the automatic_async value.

Would be nice the fix this issue ASAP, but until that I will switch to automatic capture method, even though automatic_async would be faster based on docs (https://docs.stripe.com/payments/payment-intents/asynchronous-capture?locale=en-GB)

Below is a screenshot if it helps somebody to create a PR which fixes this issue:

Screenshot 2024-05-08 at 19 16 47

Dall127 commented 3 months ago

I'm also experiencing the same issue on my new integration of stripe (focused on the web). I'm unsure if it's an issue on mobile though. Is there a timeline for these things @remonh87?

Andrea951112 commented 1 month ago

There is any update on this bug? @remonh87

aco01-fl commented 1 month ago

Hi @jonasbark, @remonh87, could you please provide any help here?

aco01-fl commented 1 month ago

automatic_async is crucial to avoid redirects in PWA that creates issues in the user experience. Thanks a lot for your support.