#uh oh
1 messages · Page 1 of 1 (latest)
Hi there
Not sure what you mean by "renew a pending payment intent"?
Can you describe more about what you are trying to do?
Hi!
For example, I create a payment intent that is in the pending state (it has not been charged yet). I would like that payment intent to automatically renew if the authorization expires, instead of cancelling the payment intent.
Ah thanks for clarifying. By "pending" you mean "requires_capture" as the status of the PaymentIntent.
No there is no way to have it automatically renew. You can listen for webhooks and use the payment_intent.canceled hook to re-authorize that PaymentMethod but you would have to use a new PaymentIntent.
Yes exactly!
So basically, you would create a new payment intent?
Yep
What if the user does not want to attach their cards to their account?
for example:
The user buys a product, and does not want to attach their card to their account. Therefore, my API attaches the payment method XYZ to the customer, and then creates the payment intent, and then detaches the payment method XYZ from the customer.
Would I be able to create a payment intent for that payment method XYZ still?
I see.. Would there be another possible solution for this use case then?
Another solution to re-authorize a card that is not stored?
Yep
Yeah not possible
So right now the flow I would like to implement is:
- User buys a product (creates a payment intent that will expire in 7 days)
- I will only charge the user once the product ships (sometimes, it will take more than 7 days)
I was thinking maybe if there was a way to create a payment intent that will be created at a later date?
Sure that's possible, but it still requires storing the card
You would use a SetupIntent to collect the card
Then charge it off-session later on.
But it is always possible here that the charge later is declined.
So that is a risk if you are going to handle fulfillment before you get a successful auth
I see...
The flow would be
- User buys a product: I setupIntent to collect card
- Once the item ships, I charge the card immediately
- if the card successfully goes through, i ship the product
Then this problem would be avoided correct?
Yeah that sounds like it would work to me.
The only caveat is that we NEED to save the payment method to the customer
Yep it will be required in either of the solutions above
With your workaround, you could detach that PaymentMethod once you successfully charge it though
Thank you so much for your help!