#nickderobertis

1 messages ยท Page 1 of 1 (latest)

main copperBOT
wide raptor
#

Hi ๐Ÿ‘‹

#

I would think so. Do you have an example Payment Intent ID or request ID I can look at?

tender cypress
#

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

wide raptor
#

Ah yes

#

the reason the event didn't fire is the payment intent didn't cancel

tender cypress
#

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

wide raptor
#

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

tender cypress
#

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

wide raptor
#

Do you have the Payment Intent ID that this corresponds to?

tender cypress
#

Let me lookj

#

It looks like actually I guess the hold expired and that caused it to move to canceled

wide raptor
#

Oh, because it was confirmed but not captured. Yes that makes sense

tender cypress
#

Ah ok, we're all good here then. Thanks

wide raptor
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚

tender cypress
#

Thank you! Actually one more follow up question investigating this.

wide raptor
#

Lemme take a look

#

Okay because it never succeeded

#

The current status is requires_capture

main copperBOT
tender cypress
vestal bone
#

Hello! I'm taking over and catching up...

tender cypress
#

Hey, no worries, give me a minute anyway to find the most relevant info for you

vestal bone
tender cypress
#

Yeah thanks I'm seeing that now, trying to understand how that happened, give me a min

#

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?

vestal bone
#

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.

tender cypress
#

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.

vestal bone
#

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?

tender cypress
#

the latter

vestal bone
#

Yep, okay, so in that case you want to listen for payment_intent.amount_capturable_updated as you mentioned above.

tender cypress
#

Ok cool, thanks for your help!