capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
https://capacitor-community-stripe.netlify.app/
MIT License
198 stars 77 forks source link

Android Paymentflow doesn't create card on stripe customer #391

Closed mgasnier95 closed 1 month ago

mgasnier95 commented 1 month ago

Platform

Describe the bug

Hello,

When I use createPaymentFlow on the web, everything works perfectly. However, when I use it on Android, everything appears to work fine, and I get the cardNumber returned. But the card is not being added to my Stripe customer.

I've followed all the steps in the documentation, including configuring MainActivity.java, variables.gradle, and initializing Stripe.

Here are the package details: "@capacitor-community/stripe": "^6.2.1", "stripe-pwa-elements": "^2.1.0"

On the web, I can see requests being sent in the network console when I click the "Add" button, but no requests are being made on Android.

To Reproduce

        await Stripe.createPaymentFlow({
          setupIntentClientSecret: response["paymentIntentClientSecret"],
          customerEphemeralKeySecret: response["ephemeralKeySecret"],
          customerId: response["customerId"],
          merchantDisplayName : "MerchantNameTest"
        });

        let result = await Stripe.presentPaymentFlow();

Expected behavior

Add new card into stripe with android app

Using Function:

mgasnier95 commented 1 month ago

My mistake : I forgot await Stripe.confirmPaymentFlow();