#uh oh

1 messages · Page 1 of 1 (latest)

atomic ledgeBOT
teal glen
#

Hi there

#

Not sure what you mean by "renew a pending payment intent"?

#

Can you describe more about what you are trying to do?

hot summit
#

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.

teal glen
#

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.

hot summit
teal glen
#

Yep

hot summit
#

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?

teal glen
#

No

#

Once the PaymentMethod is detached then it is consumed and can't be used again.

hot summit
teal glen
#

Another solution to re-authorize a card that is not stored?

hot summit
#

Yep

teal glen
#

Yeah not possible

hot summit
#

So right now the flow I would like to implement is:

  1. User buys a product (creates a payment intent that will expire in 7 days)
  2. 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?

teal glen
#

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

hot summit
#

I see...

#

The flow would be

  1. User buys a product: I setupIntent to collect card
  2. Once the item ships, I charge the card immediately
#
  1. if the card successfully goes through, i ship the product
hot summit
teal glen
#

Yeah that sounds like it would work to me.

hot summit
#

The only caveat is that we NEED to save the payment method to the customer

teal glen
#

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

hot summit
#

Thank you so much for your help!