#luccccas
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
Hi ๐
Some more information: I'm using Stripe elements to display a "Update payment" snippet in my web application.
Currently, we do offer CashApp to our customers, but I'm having trouble capturing the error in test mode
are you following this guide https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=elements#web-submit-payment
@grand anvil all yours again
@final socket No, not really, I wasn't following that guide.
But my implementation is pretty similar to that:
const { error } = await stripe.confirmPayment({
elements,
redirect: "if_required",
confirmParams: {
save_payment_method: true,
return_url: window.location.href,
},
});
if you read the comment in the if(error) block from the link I sent you
This point will only be reached if there is an immediate error
I see, so CashApp error is not considered an immediate error
Question: is there a way to identify an "immediate success" from stripe.confirmPayment?
it depends on the type of the payment method
I'm thinking ๐
Guess in my case relying on paymentIntent.status = succeeded is enough
Sharing more of what I'm thinking, please chime in if you feel like it might drastically affect the logic
Success criteria = Boolean(error) === false && paymentIntent.status === "succeeded"
Error criteria = Boolean(error) === true || paymentIntent.status === "requires_source" (maybe change the latter to paymentIntent.status !== "succeeded")