#harshit-paymentelement-applepay
1 messages · Page 1 of 1 (latest)
@shy field do you have more details? What do you call "dev" as an environment?
You're going to have to debug this as a developer, look at the JS console, the logs, the network tab, etc.
I have checked there is no error
Can we setup a call on tuesday or wednesday.. just ti check what is happening exactly
??
No we don't do calls
I'm trying, you need to provide a lot more actionable information. Your exact code, how you handle errors, why you think this is a Stripe-specific error (as that UI modal thing with the error is not a Stripe thing)
harshit-paymentelement-applepay
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: process.env.REACT_APP_URL + "/driver/confirmation",
},
});
if (error) {
dispatch(loaderActions.show({ show: false }));
if (error.type !== "validation_error")
dispatch( messageActions.show({
openPopup: true,
messageBody: CD_TOLL_PAYMENT_FAILED_SUB_LABEL,
messageHeader: CD_TOLL_PAYMENT_FAILED_LABEL,
type: "",
showClose: true,
})
);
}
This is the code which I am using
So it is going on error and we are printing exact error what is coming from stripe directly
So not really right? You get an error in if(error) and then you ignore that error entirely and log your own text
Try logging the exact error you get in that part of the code, like log the whole error object
Yes we have done the same thing what you are saying
Thats why in the abice screenshot you are able to see that error
I have taken the screenshot after modifying the code
But then why share a different code? Sorry I'm confused
and the error is truncated and unreadable
can you please log the exact error and then share that exact error in text here?
In the above screenshot the message object is exactly what we are getting from stripe
Yeah sorry I'm really trying to help you. I asked for code but you shared different code than the picture. I asked for the exact error message but you said "it's in the picture"
Please try and do a little of extra work to make it easier for me to help you. Please copy-paste the exact error message in text in this chat. And please share the exact code that maps to that picture
Something went wrong. Unable to show Apple Pay. Please choose a different payment method and try again.
This is the error
👋 jumping in to help as things are getting busy.
To be clear, the error returned by stripe.confirmPayment({...}) is what you're printing in the modal?
In the above body you can see messageBody: CD_TOLL_Payment_failed _label
We have modified that in our code and printing the exact error what is coming from stripe and apart from that code is same
Yes
Yes
Is the page you're testing this on, live? If so, can you share the URL?
I mean we can't do much with just the account ID as we'll need to look at the exact instance where this is happening.
We can only speculate which won't help much.
We can setup a meeting, it will be really helpful
As mentioned earlier, that's not something our team offers. If you can't share the URL publicly, you can DM it to me or post here and delete.
If none of those work for you then you'd likely need to work with our support team via
https://support.stripe.com/?contact=true
In the picture you shared, the screenshot is from an iPhone, have you tested the site on a mac or a different device?
I have tested that in iphone safari browser
No sorry, none of them will work for me
How exactly did you check the client-side logs?
Fwiw, here's a great resource that would let you debug websites on an iOS device
https://www.browserstack.com/guide/how-to-debug-on-iphone
It is quite un-natural for the SDK operation to fail without an error. Would recommend double checking the client-side logs for any wallet issues.
That's indeed weird, which is why we need to look at the exact example where you're seeing this issue. Without that, there's not much we can do.
Ok
Additionally, one more thing I'd recommend checking is if there are any different environment variables you're setting in your QA/Prod environments versus Dev which might be affecting this
can you share the account ID?
Your domain registration looks fine. Do you have test license plate number that can help me get to the checkout page?
yup that worked
looking at the error in the console
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.
Can you share the code that calls stripe.confirmPayment(...)
No. You only shared confirmPayment(...) function.
You haven't shared the code that triggers a confirmPayment call (code that calls stripe.confirmPayment
Like the code that configures and runs when clicking on "Pay" button
Right now i dont have access to UI code, the UI developer is on leave
What is this error?
stripe.confirmPayment needs to be called from an event listener/handler.
I have a feeling your app calls this function some other way
which is triggering this error
But we are calling the same code in qa and pre prod and there it is working fine
Also I'm seeing some different error on the page (not the one you're seeing)
So yeah this means that there has to be some differences between the code thats running on your dev vs other env
We have deployed our code
With hard coded text
But to see what error we are getting we just replace the hardcoded text with stripe error
Not sure what you mean by that. but I also see
{type: "invalid_request_error", message: "Something went wrong. Unable to show Apple Pay. Pl… choose a different payment method and try again."} in the console after
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.
so I'm quite sure that's related
There must be some differences in the way confirmPayment is being called from different environments
Can you remove above pic
sure
I will check with my UI developer
I'd recommend working with the UI developer and inspecting the code thoroughly
yeah
that's likely the best option
But as far as we know we deploy the same code
Everywhere
So there will be no difference in the way we are calling confirmPayment
But for googlePay it is working fine
In all env
We'll need to take a look at more code than what you've shared thus far to confirm there are no differences.
My best guess is that confirmPayment isn't being called directly inside the event handler for button click or form submit and is probably being called from a hook/diff function.
I'm definitely speculating since I haven't looked at your complete code but the difference here could be the latency (dev servers generally have higher latency than QA/prod servers).
So the hook/function might be performing faster on QA/Prod
which then avoids getting detected as an IntegrationError
Ok ok got it
I'd highly recommend double checking the code with your UI dev to make sure that the function is being called from the event handler
Ok sure