#pure_ece-callback
1 messages ¡ Page 1 of 1 (latest)
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.
- pure_elements-ece-stripejs, 3 days ago, 28 messages
- pure_docs, 5 days ago, 24 messages
- pure_docs, 6 days ago, 8 messages
đ 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/1235635875543646309
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey @robust flume! I'm happy to help but I will need a detailed write up of the issue, your exact code or if possible a live demo page where I can easily see what's happening
pure_ece-callback
Hi, in my confirm event, I'm calling stripe.createConfirmationToken() and immediately failing afterwards with event.paymentFailed();
Sorry that's still really high level and vague. Can you show exact code, exact error and why you are calling that event?
I'm calling that to test if I can use that callback to let the customer know the payment did not go through for whatever reason. The code is quite simple.
const stripeEvent = async(event: StripeExpressCheckoutElementConfirmEvent) => {
await stripe.createConfirmationToken({elements});
event.paymentFailed();
};
Okay so can you do it without creating a ConfirmationToken? It doesn't really make sense to do both together
I plan to use the confirmation token to do a server-side auth, how would I inform the client that it failed or not?
You would show a failure in your UI in that case
But how do I prevent the apple pay sheet from showing a success?
hum I'm sorry, which exact docs are you following? Because https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#submit-the-payment shows how to show the error in your own UI instead
The doc you linked is a client-side auth.
I'm attempting server-side auth with a confirmation token.
sure but the doc I linked shows you how to display an error right? This happens after the confirmation and you would do the same with yours. To confirm server-side you have to make a call to your server, and get a succes/failed response right?
yes, but I want to prevent the apple pay sheet from showing a success
I do plan on showing my own error with more details, but it looks deceiving to have the apple pay sheet show a "success" when it wasn't.
I presume this paymentFailed() callback is exactly for that purpose, to fail on the apple pay sheet as well.
I tried locally and expressCheckoutElement.on('confirm', async (event) => { console.log("handle error"); event.paymentFailed({error: "testing 123"}); return false; } works for me for example and I see the UI show an error (though not that string)
yes, that works for me as well. however, if i make the confirmation token call first, that paymentFailed() callback no longer works.
Ack, let me try that, give me a few minutes
okay yeah no I can repro. Feels really strange, give me a few minutes
(might take a bit of time but pairing with someone else on my team, I had never done a call before that event.paymentFailed() so never realized it would error that way)
(still working on it)
okay back