Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asaarnak opened this issue Sep 1, 2022 · 5 comments
Labels
blocked This issue is blocked by an external dependency issue bug Something isn't working Stripe sdk Issues related to the Stripe sdk

Comments

@asaarnak
Copy link
Contributor

asaarnak commented Sep 1, 2022

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.

if let token = paymentMethodData?["token"] as? String {
let methodParams = STPPaymentMethodCardParams()
methodParams.token = RCTConvert.nsString(token)
return STPPaymentMethodParams(card: methodParams, billingDetails: billingDetailsParams, metadata: nil)
}
guard let cardParams = cardFieldView?.cardParams ?? cardFormView?.cardParams else {
throw PaymentMethodError.cardPaymentMissingParams
}

@asaarnak asaarnak added the needs triage Needs triage label Sep 1, 2022
@asaarnak asaarnak changed the title When using paymentMethodId in confirmSetupIntent on iOS plugin throws PaymentMethodError.cardPaymentMissingParams but Android plugin works Stripe.instance.confirmSetupIntent throws PaymentMethodError.cardPaymentMissingParams on iOS only Sep 1, 2022
asaarnak added a commit to asaarnak/flutter_stripe that referenced this issue Sep 1, 2022
@remonh87
Copy link
Member

Will be waiting on stripe/stripe-react-native#1124 to be fixed.

@remonh87 remonh87 added bug Something isn't working Stripe sdk Issues related to the Stripe sdk blocked This issue is blocked by an external dependency issue and removed needs triage Needs triage labels Sep 12, 2022
@fabioselau077
Copy link

Will be waiting on stripe/stripe-react-native#1124 to be fixed.

I have the same error but in a different function
await Stripe.instance.createPaymentMethod(PaymentMethodParams.card())

@asaarnak
Copy link
Contributor Author

asaarnak commented Nov 3, 2022

@remonh87
The fix has been merged on 26 Sept. stripe/stripe-react-native#1151
Waiting for a new release.

@jonasbark
Copy link
Member

@asaarnak it's been merged, but not released as of yet. We will release a new version once they do.

@remonh87
Copy link
Member

should be solved in latests releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked by an external dependency issue bug Something isn't working Stripe sdk Issues related to the Stripe sdk
Projects
None yet
Development

No branches or pull requests

4 participants