#nickderobertis
1 messages ยท Page 1 of 1 (latest)
Hi ๐
I would think so. Do you have an example Payment Intent ID or request ID I can look at?
Sure, let me get that for you. I ran a quick test and didn't see an event fired.
Request ID is req_7TMTxGfyCPrx6N
Payment intent ID is pi_2NW4ekWVt9vwrtED1RA8bWrg
Hmm actually I wonder if something else is going on. I saw an error about canceled payment intents in our logs, but it seems like the payment intent is not actually gettting canceled like this
it falls back to a status of requuires_payment_method
Which makes sense. The idea beind the Payment Intent is you can re-use it until it is successful
Makes sense. What can cancel a payment intent? Because we got this in logs, and I had thought what I described above was the cause but it doesn't seem like it.
This PaymentIntent's amount could not be updated because it has a status of canceled. You may only update the amount of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation, requires_action
We don't have any explicit flows that intend to cancel payment intents
Hmmm... generally you need to explicitly cancel them: https://stripe.com/docs/api/payment_intents/cancel
Do you have the Payment Intent ID that this corresponds to?
Let me lookj
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It looks like actually I guess the hold expired and that caused it to move to canceled
Oh, because it was confirmed but not captured. Yes that makes sense
Ah ok, we're all good here then. Thanks
Happy to shed what ๐ก I can ๐
Thank you! Actually one more follow up question investigating this.
Do you know why the payment_intent.succeeded event never fired for this payment intent? https://dashboard.stripe.com/test/payments/pi_2NVzFrWVt9vwrtED0Z6jGkp1
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Lemme take a look
Okay because it never succeeded
The current status is requires_capture
Hmmm.... ok well then actually it seems like in the usual case where we are trying to place a hold it's actually charging the card. E.g. here I tried to do a $1 hold but it looks like it actually charged. https://dashboard.stripe.com/test/payments/pi_2NW4ekWVt9vwrtED1RA8bWrg
Hello! I'm taking over and catching up...
Hey, no worries, give me a minute anyway to find the most relevant info for you
For that last Payment Intent you set capture_method to automatic when you created it, so no hold was placed, the money moved immediately when the confirmation succeeded: https://dashboard.stripe.com/test/logs/req_6JcBNpiiPNdzue
Yeah thanks I'm seeing that now, trying to understand how that happened, give me a min
Ok yeah not sure what happened there, but I just triggered again and this time it sent capture_method as manual. so now it seems to be in the correct state https://dashboard.stripe.com/test/payments/pi_2NW5SmWVt9vwrtED1gguhhwC
But I was originally expecting to use the payment_intent.succeeded event to update our system when this happens. I guess I need to use payment_intent.amount_capturable_updated instead? Does anything else trigger that event?
Can you tell me more about when exactly you want to update your system? I want to make sure I understand all of the possible update triggers you might want to use.
We have a payment object in our system and we normally create it and attach a payment intent to it at the same time. But if the user cancels and comes back to make the payment, we'll look up if there's an existing payment in our DB and re-use the corresponding payment intent.
Without holds this worked fine, because we only ever had a single payment at once. But now with holds, we might place a hold and then later do a different charge. So when we collect the card for the hold, we want to update our payment object so that it will be considered complete and the payment intent won't be re-used for the next payment attempt.
To clarify, you want to ignore Payment Intents which have a Payment Method associated regardless of their status? Or do you only want to ignore Payment Intents which have successfully placed a hold on funds but those funds haven't been captured yet?
the latter
Yep, okay, so in that case you want to listen for payment_intent.amount_capturable_updated as you mentioned above.
Ok cool, thanks for your help!