#jdommel_api

1 messages ยท Page 1 of 1 (latest)

still crestBOT
#

๐Ÿ‘‹ 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/1471127272495911092

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

rotund geyser
zealous ermine
#

Hi, here's one on test mode pi_3SzckPDt9TCFajwK2X3zG7Ce

rotund geyser
#

Thanks, just taking a look

#

I don't see any attempt at authentication, so it doesn't appear to be a 3DS issue. Does the user complete the payment flow in the sheet? (Enter card details and tap "Pay") Are you seeing any errors in the PaymentSheet UI itself?

zealous ermine
#

I don't see any errors and the payment succeeds

#

It happens at confirmation

rotund geyser
#

The payment succeeded for the above example? pi_3SzckPDt9TCFajwK2X3zG7Ce

zealous ermine
#

Sorry, I must have mistaken, it this one that succeeded pi_3SzceQDt9TCFajwK10p8skRu

rotund geyser
#

Can you try setting android:launchMode="singleTask" in your AndroidManifest.xml file. This can sometimes resolve issues caused by 3DS flow interrupting the lifecycle

zealous ermine
#

It's already set this way

rotund geyser
#

Could you share how you're calling initPaymentSheet in your code?

zealous ermine
#

/** Handles payment sheet initialization */
const initializePaymentSheet = useRef(
async (params: Parameters<typeof fetchPaymentSheetParams.current>[0]) => {
try {
const result = await fetchPaymentSheetParams.current(params);
const { clientSecret, ephemeralKey, customerId } = result || {};

    /** @warning added customerId and ephemeralKey to avoid errors */
    /** check if this causes no bug */
    if (!clientSecret || !customerId || !ephemeralKey) {
      return;
    }

    console.log('[Payment] Initializing payment sheet');

    const { error, paymentOption } = await initPaymentSheet({
      customerId,
      customerEphemeralKeySecret: ephemeralKey,
      paymentIntentClientSecret: clientSecret,
      /** needed to complete payment in multiple steps - confirmation will be needed later */
      customFlow: true,
      merchantDisplayName: 'Toasty',
      style: 'alwaysLight',
      returnURL: 'toasty://panier',
    });

    error
      ? console.log(error, '----------error-------------')
      : console.log('[Payment] Payment sheet initialized without error');

    paymentOption &&
      dispatch(
        setPaymentMethod({
          label: paymentOption.label,
          image: paymentOption.image,
        })
      );
    Keyboard.dismiss();

    return;
  } catch (error) {
    console.log(error, 'error');
    throw error;
  }
}

);

rotund geyser
#

And what payment method are you trying in your tests? (e.g. Google Pay, Link, directly entering card details) Is the 3DS flow triggered?

zealous ermine
#

Regular card payment

#

It works fine on iOS

still crestBOT
tame flare
#

Hello! I'll be taking over as @rotund geyser had to step away - let me get caught up ๐Ÿ™‚

zealous ermine
#

Should I explain again ?

tame flare
#

No, I can review the previous messages - thanks!

#

The logs I see for pi_3SzceQDt9TCFajwK10p8skRu suggest there's no 3DS flow, did you see one triggered when confirming the payment?

#

Also does this happen for every payment on Android?

zealous ermine
#

It seems to happen on a big part at least... I thought about the 3DS flow because I see logs suggesting that my app is backgrounded, and all the tasks are stuck

tame flare
#

So you don't actually see or interact with a 3DS page when testing?

zealous ermine
#

No, I don't see anything happening, same in production

tame flare
#

Asking because the guide doesn't mention usePaymentSheet but that might be a gap on our end.

zealous ermine
#

I use customFlow: true at initPaymentSheet

tame flare
#

However, it mentions this:

When the customer taps Buy, call confirmPaymentSheetPayment. It calls the confirmHandler callback you passed to initPaymentSheet with a ConfirmationToken representing the customerโ€™s payment details and preferences.

And I don't see confirmHandler in your code snippet so the promise might be stuck as it expects that.

#

To be honest, I'm surprised it works without it ๐Ÿ˜…

#

I suspect it's working because you're passing the paymentIntentClientSecret upfront using the intent first pattern rather than the deferred intent patten used in the guide.

zealous ermine
#

Thanks, I can try that, I can't do it right but can I resume this conversation later when I can ?

tame flare
#

I will also ensure we improve our guides around this ๐Ÿ™

zealous ermine
#

Thank you