stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

Stripe.instance.confirmSetupIntent throws PaymentMethodError.cardPaymentMissingParams on iOS only

Open remonh87 opened this issue 3 years ago • 0 comments

Describe the bug In the Flutter Stripe lib we got the following issue

To reproduce: Works on Android. Throws on iOS.

      await Stripe.instance.confirmSetupIntent(
        'paymentIntentClientSecret',
        PaymentMethodParams.cardFromMethodId(
          paymentMethodData: PaymentMethodDataCardFromMethod(
            paymentMethodId: 'paymentMethodId',
          ),
        ),
      );

Probably a bug is here: Currently we only check for paymentMethodData?["token"] in line 159. And then PaymentMethodError.cardPaymentMissingParams is thrown in line 166. We should add similar check for paymentMethodData?["paymentMethodId"] like token check in lane 159.

https://github.com/stripe/stripe-react-native/blob/3d32e7d44f8c22e3867b80ff50759fe6c55bff70/ios/PaymentMethodFactory.swift#L158

User created a pull request on our lib but since we sync the SDK with this repo it would be better to fix it here. Pull request: https://github.com/flutter-stripe/flutter_stripe/pull/901/files

remonh87 avatar Sep 12 '22 18:09 remonh87