#samurai_unexpected

1 messages · Page 1 of 1 (latest)

deft sailBOT
#

👋 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/1445886086609109163

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

silk jetty
#

Hello
Can you share the exact code you're using for this?

Do you have any async code that runs before elements.submit()?

red zodiac
#

Hi, here is my code:
this.$root.$on(checkout::reservation-submitted, async () => {
const {error: submitError} = await this.elements.submit();
if (submitError) {
console.error('Validation error:', submitError.message);

      let errorMessage = submitError.message ? submitError.message : 'Something went wrong. Please try again or choose another payment method.'
      this.$root.$emit('payment-container::verification-failed', errorMessage);

      return;
    }

    const {confirmationToken, error} = await this.stripe.createConfirmationToken({
      elements: this.elements,
      locale: 'en',
    });

    if (error) {
      this.$root.$emit('fatal-error', 'Failed to create confirmation token:', error.message);
      console.log('Failed to create confirmation token: ' + error.message);
    } else {
      this.$root.$emit('gateway-changed', {
        gateway: 'stripe',
        gateway_data: {
          'confirmation_token': confirmationToken.id,
          'payment_intent_id': this.paymentIntentId,
        },
      });

      this.$root.$emit('checkout::credit-card-was-validated');
      console.log('Got confirmation token:', confirmationToken.id);
    }
  });
silk jetty
#

Gotcha. Hmm I don't see any integration issue based on the brief code you've shared.

It's possible that it is something specific with the browser that the user is testing with OR the wallet set up etc

Unfortunately, it is almost impossible to figure out whats' going on without an exact repro 🙁

#

Do you see any specific patterns with the customers that are seeing this error? Like are they testing/paying from a specific region?

red zodiac
#

Most of our customers are in the US. The majority of users who encountered this issue are on iOS 18.x.

#

What’s strange is that for some users who hit this issue, simply clicking the submit button again is enough to complete the payment successfully on the second attempt.

silk jetty
#

Hmm I see. I am not aware of any incompatibilities with iOS 18..

Is your PaymentElement shown in a modal?

red zodiac
#

Sorry, what do you mean?

silk jetty
#

Like a pop-up style UI

red zodiac
#

The Payment Elements widget definitely loads on the checkout page, but I’m not fully sure about the Apple Pay modal. We tested on devices with different iOS versions, and the Apple Pay modal appeared correctly. How it behaves for users who hit this issue is unclear.

In the past month, we’ve had over 16k successful Apple Pay transactions, so this seems to be some kind of edge case.

silk jetty
#

Gotcha. One other thing to look for is if these customers are using private browsing / incognito mode on Safari

Generally, Stripe shows Apple Pay only when the wallet has a supported payment method/card. But if you load the page in private window then Apple Pay is rendered regardless of you having a supported card.

#

In this case, it's possible that they see some unexpected error / behavior with Apple Pay button

#

But yeah, as I mentioned earlier - it's quite impossible to debug this without a repro 🙁

red zodiac
deft sailBOT
red zodiac
#

I don’t think we can identify which users were in incognito mode and which were not. We use FullStory to track user sessions, and they don’t provide that kind of functionality.

Then I have another question: in which cases can a user receive this error?
I couldn’t find clear information in the documentation, and there’s very little detail in the source code as well.

tribal kestrel
#

Hi there 👋 Taking over for hanzo

red zodiac
#

Hi @tribal kestrel!

tribal kestrel
#

You're asking about the cases in which the "Please fill in your card details" can happen?

red zodiac
#

Yep

tribal kestrel
#

Its an error we throw when card details are incomplete in Elements - pretty much what it says on the tin, but in this case I think the question is why that came to be

red zodiac
#

So it looks like this issue is most likely a Stripe bug?

From our side, I can clearly confirm that users select the Apple Pay option in the Payment Element widget and then submit the payment form - we’re logging these actions. I don’t see any network errors between these steps or anything else that could point us toward the root cause.

#

Just in case, I’ll share the User Agent statistics for the users who encountered this issue

tribal kestrel
#

I'm not sure if we can say it is a bug without being able to reproduce and dig into what is actually happening.

red zodiac
#

Could you please let me know what information I can provide to help you reproduce this issue?

tribal kestrel
#

Do you have any Stripe objects, confirmation tokens in this case, that relate to cases where this definitely happened? Have you tried to reproduce it on your own checkout?

#

Testing end-to-end with apple pay is tricky for us because PII gets exposed through the card's details.

red zodiac
#

Unfortunately, I don’t have the confirmation token, because to obtain it, elements.submit() needs to work correctly — and for these users it returned this error instead

#

BUT I do have a confirmation token that one of the users received on their second attempt, after the first Apple Pay payment failed. I can share it if that helps.

tribal kestrel
#

I don't think it will tell us much. I'm trying to test the incognito mode theory locally on my own code to see if that turns up anything

red zodiac
#

One more thing: we’re currently using @stripe/stripe-js 7.9.0

tribal kestrel
#

tested on web - trying on iphone

red zodiac
#

Thank you very much!

tribal kestrel
#

What's your exact checkout page?

red zodiac
#

Do you need the URL or something else?

tribal kestrel
#

The URL, please

red zodiac
#

Can I send it to you by email?
My company’s policy doesn’t allow me to share such details in public places like open Discord chats (I know it sounds strange, but that’s how it is).

tribal kestrel
#

Let me have you open a support case, which I'll take, and we'll continue working on it asynchronously, which will probably be for the best anyhow. I'll likely need to work with my peers on debugging anyway.

I've tried reproducing on my mac and iphone using various combinations of private browser / not and code that is comparable to yours. Used your exact Stripe.js version, etc, but haven't been able to reproduce.

In my experience, if you're using private browser/incognito mode on chrome or safari and choose apple pay, but don't actually have cards saved, then apple pay prompts you to add a card in the apple pay UI and if you close it you return to the same state in the Payment Element as before you clicked on apple pay

#

but also, to be clear, you/your colleagues have also tried reproducing this, but have been unable to, is that correct?

tribal kestrel
#

could you confirm this point please?

but also, to be clear, you/your colleagues have also tried reproducing this, but have been unable to, is that correct?

red zodiac
tribal kestrel
#

When you submit the support ticket, could you add any stripe-related frontend code that isn't in the snippet above?

deft sailBOT
#

Hello @red zodiac, we have sent you a direct message, please check it at https://discord.com/channels/@me/1445915512709054576

  • 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
red zodiac
red zodiac
tribal kestrel
#

thanks - I'll follow up in the email. Likely that will be tomorrow. And I want to set expectations that since we don't know under what conditions this is occurring, it isn't guaranteed that we will be able to get to an answer

red zodiac
# red zodiac Here is the PaymentElements component

The external code in the checkout page logic fires the event:
self.$root.$emit('checkout::reservation-submitted');

Previously, we had an async call to Google reCAPTCHA, and we fired this event inside the reCAPTCHA callback. But this caused Apple Pay errors like:

[Error] IntegrationError: The code that shows the Apple Pay payment sheet must be invoked directly by a user activation event, like a click or a touch gesture. To prevent this error make sure the code that shows the payment sheet is at or near the top of your user gesture event handler, before any async or long-running code.

We removed all async calls between the user clicking the submit button and triggering the Payment Element submission — and the problem disappeared.