stripe-react-native
stripe-react-native copied to clipboard
Stripe.instance.confirmSetupIntent throws PaymentMethodError.cardPaymentMissingParams on iOS only
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