#jdommel_api

1 messages ¡ Page 1 of 1 (latest)

sand rampartBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1471446401429799065

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

gaunt pollen
#

hi there!

#

can you summarize your question here?

pure edge
gaunt pollen
#

but can you summarize your question here, that would be simpler than reading a long thread with back and forth.

pure edge
#

I use @stripe/stripe-react-native (just upgrade to 0.58 to try to solve my issue) and have an issue on Android. When I call the method confirmPaymentSheetPayment I see that it never resolves. The payment succeeds but I cannot perfom error or success action because the of this. And the only thing I see in the logs, is that the app seems to be backgrounded

gaunt pollen
#

thanks for the summary! having a look.

pure edge
#

It's an old implementation, with customFlow, and the bug is recent (maybe after upgrading to 0.57 version) but it ressembles this implementation, just added the confirmation handler (which I see triggered)
And can I also add that the flow works ok with Paypal, it seems to happen only with card

gaunt pollen
#

can you share the code you are using?

pure edge
#

Here is the initPaymentSheet
const { error, paymentOption } = await initPaymentSheet({
customerId,
customerEphemeralKeySecret: ephemeralKey,
/** needed to complete payment in multiple steps - confirmation will be needed later */
customFlow: true,
merchantDisplayName: 'Toasty',
style: 'alwaysLight',
// Stripe expects a URL it can intercept on return from 3DS/bank redirects.
returnURL: 'toasty://stripe-redirect',
intentConfiguration: {
mode: {
amount,
currencyCode: 'EUR',
},
confirmHandler,
},
});

#

const confirmHandler: NonNullable<IntentConfiguration['confirmHandler']> = (
_paymentMethod,
_shouldSavePaymentMethod,
intentCreationCallback
) => {
void (async () => {
try {
// We create the PaymentIntent during init (fetchPaymentSheetParams).
// If for any reason the client secret is missing, recreate a PI as a fallback.
const existingClientSecret = dataRef.current.userClientSecret;
if (existingClientSecret) {
intentCreationCallback({ clientSecret: existingClientSecret });
return;
}

    const result = await fetchPaymentSheetParams.current({ shouldRecreatePayment: true });
    const clientSecret = result && 'clientSecret' in result ? result.clientSecret : undefined;

    if (clientSecret) {
      intentCreationCallback({ clientSecret });
      return;
    }

    intentCreationCallback({
      error: {
        code: 'Failed',
        message: 'Missing PaymentIntent client secret.',
        localizedMessage: 'Une erreur est survenue pendant le paiement.',
      },
    });
  } catch (e) {
    intentCreationCallback({
      error: {
        code: 'Failed',
        message: e instanceof Error ? e.message : 'Unable to create PaymentIntent.',
        localizedMessage: 'Une erreur est survenue pendant le paiement.',
      },
    });
  }
})();

};

#

And to confirm I just call
const response = await confirmPaymentSheetPayment();

gaunt pollen
#

and the confirmHandler is never called for card payments on Andorid? but it is called for iOS or other payment methods?

pure edge
#

I see it called if I add a log in the if (clienSecret) condition

#

But the confirmPaymentSheetPayment still doesn't resolve

#

I don't see any errors though

sand rampartBOT
cunning niche
#

Hey! Taking over for my colleague. Let me catch up.

#

Could you try it now and see if you manage to reproduce the issue on it ? If so could you please share with me the reproduction steps ?

pure edge
#

It's a completely different implementation, I don't use the same hooks, so I cannot reproduce

cunning niche
pure edge
#

The example doesn't use confirmPaymentSheetPayment method, the one that is problematic
I tried to use confirmPayment but it's a different implementation then

cunning niche
#

Let me do some checks...

#

It should be the "Prebuilt UI (multi-step)"

#

I just tried it and every thing seems working fine.

#

Could you please run it locally and try to reproduce the issue you are facing ?

pure edge
#

I'm having trouble to build the app, but I'm trying