#happycamper_94472
1 messages · Page 1 of 1 (latest)
Hi Pompey!
This is the full error object we get back from the call:
{"type":"invalid_request_error","message":"Something went wrong. Unable to show Apple Pay. Please choose a different payment method and try again."}
Hello, apologies for the wait, the server has been pretty busy
Not immediately sure what may cause that but I am looking in to it. Do you have a URL for your test site where I could see this error for myself?
Can DM me if you don't want to send it in this public thread
Actually, I have a thought. Is domain registration different from domain verifiation for Apple Pay? If I submit a verification domain for Apple Pay, is there a separate step for domain registration?
I'm looking at these docs: https://stripe.com/docs/payments/payment-methods/pmd-registration
If you registered the domain for apple pay we should have converted it automatically in to that new type of registration I believe
If the Apple Pay button is showing for you, then you have the registration party done correctly
Small caveat: if you are browsing in private mode, the button will always show regardless of registration
Quick test, if you click the apple pay button at the top of this doc, do you get the same error? https://stripe.com/docs/stripe-js/elements/payment-request-button
Ok that makes sense, lastly do you know if there is a separate registartion for the test api key, or is it the same for both environments?
I do not get the same error when pressing that button
Unfortunately it isn't super easy to share my implementation with you, since it is sort of nested into our checkout flow and requires an authorized user to access
Registering in live registers you for both modes
Gotcha, still looking in to this error and will see what I can do
Would it be possible to make a simple page that is just the Payment Element to see if that also gives you this error?
I can look into this, give me a few mintues. Thanks!
Also do you have the ID of a PaymentIntent that you saw this issue with? (pi_1234)
I can check if there is anything on the logs on our side
Not seeing anything strange from the confirm side. I do see a lot of update calls on the PaymentIntent though I don't think that should affect ApplePay here.
Also have you checked your developer console to see if any other errors are showing up?
Mhmm I do see this in my console, though I'm not certain it's from Stripe yet:
IntegrationError: show() must be called from a user gesture handler (such as a click handler, after the user clicks a button).
Ah there we go! So that error comes from an Apple Requirement that the payment sheet has to be displayed soon after the user clicks on a buy button. I think the time limit is ~ 1 second
Are these update calls on your server happening after your user clicks the buy button? Or is there other significant work being done?
I am not making any show() calls manually, on the client nor on the server
Does the payment element handle this for us?
Yes, show is something Stripe.js is calling as part of the confirmPayment call
So I guess my question is if your page is doing anything between when the user clicks your buy button and when you call confirmPayment
ahh I see
let me check our code
Yes we make a call to our server before calling .confirmPayment. But once we call confirmPayment we aren't doing anything else
I can test omiiting that call to see what happens
The call to your server is likely the issue unfortunately. Apple's timing window is usually too tight for networked requests
it wokred!
Nice!
This was an unexpected requirement
Yeah it gets a lot of people. Very tight timing window.
So yeah, the solution will be to rework the page such that confirmPayment isn't waiting on that request to finish.
I have to step out but @sweet linden can help with followup questions if you run ing to Stripe.js or API questions while looking in to this.
And specifically the window is the click on the checkout button to the call to .confirmPayment?
that needs to be a quick turnaround?
Correct
I'm wondering if you have any suggestions for how we can support this requirement without undertaking a major refactor?
thank you!
Ah this is the issue with Apple requiring their sheet to be shown within ~1 second of the customer clicking buy
There's not a way to circumvent that
So you'll have to refactor unfortunately
Understood, thank you for your time and help