#tsahnar-auth-capture-expiry
1 messages · Page 1 of 1 (latest)
Good question. Looking in to it. Do you have an ID of a PaymentIntent (pi_123) that expired like that?
I dont have - but I know that they should be expired after 7 days
and when manually cancelling it the cancel reason is null
e.g. this one pi_3JwQN1DI8A3U6F9i1f0PJpI7
It looks like the cancelation_reasons that a user can set are completely separate from the automatic ones https://stripe.com/docs/api/payment_intents/object#payment_intent_object-cancellation_reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It sounds like it will be automatic in your case
Automatic is always returned as null?
what are the automatic available reason should we expect?
can we set the cancel reason when we cancel it via the API?
cancelation_reason should be automatic if it is from an authorization expiring
Yes you can https://stripe.com/docs/api/payment_intents/cancel#cancel_payment_intent-cancellation_reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so when the expiration of auth happened we should expect to recieve the event with the "automatic" cancel reason?
I am unsure of other reasons. You can tell if an automatically cancelled PaymentIntent by checking if the capture_method is manual https://stripe.com/docs/api/payment_intents/object#payment_intent_object-capture_method
And yes, I believe so but have not been able to test that theory
I would check yourself now if you can
can you take a look at this payment intent? pi_3JwQN1DI8A3U6F9i1f0PJpI7
I cancelled it manually and the capture method is manual
Look at what about it?
You wrote above that when the expiration happened it should be sent as manual
or I didnt understand you
where can I see in the docs the "automatic" cancel reason?
We just want to know when the event from stripe hits are backend for cancelled payment intent that it was because of the expiration
Right. You are setting the capture_method to manual so it will be manual when it expires
And indeed it is on the pi you provided https://dashboard.stripe.com/test/logs/req_gikI1GS4hkJc7N
capture_method: "manual",
I linked to that place in the docs before
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-cancellation_reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok so its not related to my question
But when Stripe cancells the intent because of expiration
what should be the expected reason?
Oh I see where I got confused on your terms
Stripe will not cancel PaymentIntents for failing to charge
You mean like 3DS auth right?
NO
I am talking about auth that expired after 7 days
Stripe cancells the payment intent
Holding funds and capturing them later?
yes
That is what I have been talking about, manual capture
yes
but what if no manual capture was made after 7 days
we will recieve the payment_intent.canceled event
what would be the cancellation reason if at all
we would like to catch the event and know that it was stripe that cancelled the intent because 7 days has passed
Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic).
automatic
As far as I can see. Unfortunately I don't have canceled PIs like this so I can't test that state for seven days
Can you verify it with your R&D?
I also dont see it in the docs - so its confusing to us
Yes that is how these will expire
It turns out I did have some test manual captures that did expire
A quick python snippet if you are interested payment_intents = stripe.PaymentIntent.list(limit=100) manual_expired = [ payment_intent for payment_intent in payment_intents.auto_paging_iter() if payment_intent.capture_method == 'manual' and payment_intent.status == 'canceled' and payment_intent.cancellation_reason == 'automatic' ] print(manual_expired)
Can you add it to your docs? because this does not exist as a valid reason that can be returned in the cancellation_reason field
thank you for your check!
Oh I do see it in the docs
Thanks you !
No worries! Happy we are on the same page
Thank you very much
Of course. Any further questions on this at the moment?
No thanks
No worries, just checking