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

[nativescript-stripe] confirmSetupIntent throws an error #110

Closed
sebj54 opened this issue Mar 25, 2022 · 9 comments
Closed

[nativescript-stripe] confirmSetupIntent throws an error #110

sebj54 opened this issue Mar 25, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@sebj54
Copy link
Contributor

sebj54 commented Mar 25, 2022

Hi there!

I just updated the nativescript-stripe plugin to the latest version. It turns out that my implementation does not work anymore.

So far, the payment method creation still works, but when I want to confirm setup intent with:

stripe.confirmSetupIntent(paymentMethod.id, this.clientSecret, onSuccessCallback)

I have this error:

TypeError: error.getMessage is not a function

It is thrown in this catch block:

} catch (error) {
cb(new Error(error.getMessage() || error.getLocalizedMessage()), null);
}

This happens because the error is not a Stripe error but a JS exception:

 Error: java.lang.NoSuchMethodError: no static method "Lcom/stripe/android/Stripe;.confirmSetupIntent(Landroidx/activity/ComponentActivity;Lcom/stripe/android/model/ConfirmSetupIntentParams;)V"

I wanted to debug this, but I'm a bit lost with Stripe Android documentation… There seems to be two confirmSetupIntent methods with a different signature:

Thanks in advance for your help 🙏

@sebj54
Copy link
Contributor Author

sebj54 commented Apr 4, 2022

So I digged deeper to find a solution and can't find it.

There is a method with the same signature (inspected with java.util.Arrays.toString(this.stripe.getClass().getMethods())):

public final void com.stripe.android.Stripe.confirmSetupIntent(androidx.activity.ComponentActivity,com.stripe.android.model.ConfirmSetupIntentParams)

I don't understand why it looks for a static method on Stripe instance, maybe that's part of the problem?

Is this method working on your side?

@triniwiz
Copy link
Owner

triniwiz commented Apr 4, 2022

What does console.log(androidx.activity.ComponentActivity) print ?

@sebj54
Copy link
Contributor Author

sebj54 commented Apr 4, 2022

It prints function () { [native code] }

@standevo
Copy link

standevo commented Sep 27, 2022

I have the same problem on Android 10

@triniwiz triniwiz added the bug Something isn't working label Sep 28, 2022
@triniwiz
Copy link
Owner

triniwiz commented Oct 3, 2022

Can you try 9.0.0-alpha.0 version of stripe along with 8.4.0-alpha.0 of the android runtime

@standevo
Copy link

standevo commented Oct 8, 2022

@triniwiz Unfortunately this (9.0.0-alpha.0) does not fix the problem (tested on Android 10 & 13).

@matteonatale
Copy link

Hi there, I'm having the same issue of @sebj54 and I'm in the same condition: after plugin update my implementation does not work either. Is there any news?

@sebj54
Copy link
Contributor Author

sebj54 commented Jan 16, 2023

Hi @triniwiz, I just tested the latest version (9.0.0-beta.1) and it still has the same problem. How can I help? Do you need a reproduction?

@sebj54
Copy link
Contributor Author

sebj54 commented Jan 23, 2023

The error seems fixed with latest beta (9.0.0-beta.2). Thanks @triniwiz!

@sebj54 sebj54 closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants