#thifiel
1 messages · Page 1 of 1 (latest)
Hi
I have migrated an existing integration to payment elements but seeing periodic duplicated payments which result in having to refund one of the transactions. Can't replicate this issue locally and it seems to be completely random.
Is there two PaymentIntent created ?
In some instances, a new payment intent is generated and confirmed straight after the first one went through.
What is generating the new PaymentIntnet? your backend ?
Yes, two payment intents get created. But there have been instances where the same payment intent was confirmed twice, resulting in an error from stripe saying that it has already been confirmed. I've put some backend code in place to not attempt confirming again when the status comes back as payment_intent_unexpected_state
Yes, it comes from the backend but under normal circumstances, before migrating this was only used to confirm the payment intent when a requires_confirmation status was returned, so for the most part, when 3ds was required. It's a simple call to stripe.handeCardAction which then goes back to the backend to continue where it left off
The actions you are describing are triggered from your integration, it seems a concurrency issue on your backend/integration
You should probably debug further all the process implicated in your Checkout Flow
But there seems to be some automatic confirmation behind the scenes which happens when using payment elements which didn't happen before, despite still having confirmationMethod set to manual in the payment intent creation code
But there seems to be some automatic confirmation behind the scenes which happens when using payment elements
No there is no automatic confirmation/Action made from the Stripe Element
The goal of using Stripe Element is to give developers the ability to synchronise all the events and the flow
I suspected as much. I think our main issue is still manually confirming using handleCardAction as opposed to web hooks, which I understand is the better approach. Was just wondering if there was a workaround before going away and overhauling all of the front-end integrations to use stripe.confirmPayment instead
Was just wondering if there was a workaround before going away and overhauling all of the front-end integrations to use stripe.confirmPayment instead
You should use confirmPayment
That' the better approach
Ok, thank you for your time, that makes sense. We will look into it.