#usm-seong_unexpected

1 messages ยท Page 1 of 1 (latest)

round mesaBOT
#

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

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

mossy walrusBOT
#

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.

brisk sinew
#

and this is what I get from console. you can observe confirmPaymentSheetPayment threw an error

#

this is one of the credit cards from Stripe website

restive sun
brisk sinew
#

seti_1PqzFFFbFOzNrsPEDYff8MIp

restive sun
#

Looking..

#

Let me grab someone on my team who have more expertise with RN, hang tight

brisk sinew
#

sure thank you

vestal axle
#

Hello, still looking in to this. Is there a specific doc of yours that you were following when building this? Nothing is immediately jumping out at me from your code but we have a lot of flows that are very subtlely different ways and I am wondering if our SDK expects something to be called in a slightly different way here

brisk sinew
#

hello i'm not sure cuz this is not what I built.. i'm just debugging this

#

the person who built this is not available

vestal axle
#

UI-wise does it look like the sheet is actually dismissing before this error happens?

brisk sinew
#

yeah the sheet (bottom pop up modal) is dismissed

#

or after/before

#

not sure the exact timing but it is dismissed

vestal axle
#

What do you mean by "after/before" there?

brisk sinew
#

i'm not sure exact timing

#

but when the error happens

#

it is dismissed

#

it seems the sheet is dissmissed even before the error

round mesaBOT
vestal axle
#

Interesting, and what is happening with the dispatch event between your present and confirm calls?

brisk sinew
#

sorry not sure what you mean

vestal axle
#

From your code:

    await fetchPI();
    const { error: presentError } = await presentPaymentSheet();
    if (presentError) {
      console.log('presentError = ', presentError);
      if (presentError.code === PaymentSheetError.Canceled) {
        return;
      }
      dispatch(
        setAddCreditCardNetwork({
          status: ERROR,
          error: `Something went wrong with Present. Error code: ${presentError?.code || 'default'}`,
        }),
      );
      return;
    }

    dispatch(setAddCreditCardNetwork({ status: LOADING, error: null }));

    const { error: confirmError } = await confirmPaymentSheetPayment();

    console.log('confirmPaymentSheetPayment confirmError = ', confirmError);
    if (confirmError) {
      dispatch(
        setAddCreditCardNetwork({
          status: ERROR,
          error: `Something went wrong with Confirm. Error code: ${confirmError?.code || 'default'}`,
        }),
      );
      return;
    }
brisk sinew
#

this issue persists even after i remove that dispatch event

vestal axle
#

And I see that that openPaymentSheet method is returned by your useOpenStripePaymentSheet hook. Can you show me the snippet of code where you are actually calling openPaymentSheet?

brisk sinew
#

const { openPaymentSheet, isAddCCLoading } = useOpenStripePaymentSheet();

  <Button
    disabled={isAddCCLoading}
    style={{ marginTop: 20, width: '100%' }}
    title="Add a new card"
    onPress={openPaymentSheet}
  />
#

again, it just works fine with other credit cards. it's just this 3ds card

#

that I shared

vestal axle
#

Correct, that is what we are trying to debug

brisk sinew
#

๐Ÿ™

vestal axle
#

I think the best way to debug at this point would be to simplify your app to just a button that calls that function and see if it still sees this issue for 3DS cards. If it does work, slowly add things back until the issue shows up again. If it is still not working, if you can send your simplified project to us through a support ticket, we can try running it on our side and reproducing/diagnosing this on our side https://support.stripe.com/?contact=true

brisk sinew
#

will do. it will take some time but i have another question in the meantime. currently when I click the button it opens the modal right. but when I click the button twice, the modal opens up and another one opens up on top of the existing one. and when I try to close the modal, it closes the first but but the second one remains forever. no way to close it unless I close the app entirely and come back.

vestal axle
#

Interesting. That feels like it may be related because the error you are running in to is supposed to detect and prevent exactly that. That being said I think it would still be helpfyl to disable the button sooner so that present isn't called when there is already a sheet. It looks like your code disables that button based on isAddCCLoading which is defined in your useOpenStripePaymentSheet code as
isAddCCLoading: addCreditCardNetwork.status === LOADING,
But your code doesn't set that status to loading until after the presentPaymentSheet returns, so the button would in theory be able to call your openPaymentSheet method that whole time.

brisk sinew
#

gotcha let me try

#

how do I listen to when the modal is dismissed?

#

because when I set a flag whether a sheet is opened,

#

i should set that to false when the modal is closed

#

if a user closes the modal before submit

vestal axle
#

The presentPaymentSheet promise resolving should indicate that the sheet is closed

#

So your code is fine to show the loading spinner and whatnot there. I think it is more that the button was still enabled that whole time

brisk sinew
#

gotcha thank you