#juchom-subscriptions-failedpayment

1 messages ยท Page 1 of 1 (latest)

scenic gullBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

rose cairn
#

Hello

lapis fiber
#

Hello !

rose cairn
#

So to clarify, you are using payment_behavior: 'pending_if_incomplete when you update a Subscription and you are encountering a failure when 3DS is required, is that correct?

lapis fiber
#

yes this is exactly my use case

rose cairn
#

Okay and is your customer on-session when you perform this update?

lapis fiber
#

Actually no, I thought session was only possible when we create the subscription.

rose cairn
#

I mean is your customer actually in your flow or not?

#

Like are they present to complete 3DS?

lapis fiber
#

when they update the subscription, they are on our website

#

so yes the user is present

rose cairn
#

Do you have an example Subscription from a test that you ran that I can look at?

#

I think you just need to pass off_session: false when you perform your update

#

And that will move the PaymentIntent into a requires_action where you can then have the customer complete 3DS

lapis fiber
#

This subscription : sub_1OXQqvIadtM5sJMb5rajkABf

#

This payment intent : pi_3ObOD2IadtM5sJMb23P8ylQq

rose cairn
#

Yep, can you run a test where you set off_session: false

lapis fiber
#

Where should I set the off_session ?

In my subscription_update_option ?

rose cairn
#

Hmm actually it might not let you do this since pending updates are somewhat limited

lapis fiber
rose cairn
#

Yep that's what I was worried about

#

I think you need to update again but not use pending_if_incomplete if you want to handle this case. Let me double check to ensure I'm not missing anything.

#

Okay I confirmed.

#

So the two options here are that when you receive an authentication_required decline on your update then you either re-update the Subscription using payment_behavior: default_incomplete, or you can simulate a pending update by actually creating a new Subscription with the updated Price and have the customer start that Sub, if they do that successfully then you could cancel the old Sub.

lapis fiber
#

Actually I don't receive authentication_required I received requires_payment_method when I try to update the subscription.

The flow I want to do is the following :
Send the update susbcription request to Stripe, but wait for payment completion before applying the changes to the subscription (aka pending_if_incomplete).

What would be the recommended way to handle payment issues, 3DS or expired card, without changing the subscription ?

scenic gullBOT
placid cave
#

Hi ๐Ÿ‘‹

I"m stepping in for my colleague who needs to go soo and catching up.

lapis fiber
#

Hello

placid cave
#

Okay so have you tested creating a Subscription update with payment_behavior: 'pending_if_incomplete'?

lapis fiber
#

Yes, this is the first part of my workflow and it works well with card 4242 and checking if pending_result is null.

Now, I added the card 0341 (the one that require a 3DS on next payment).

When I do the update and the check pending_result, I have an object, so I know that there is an issue with payment.

If I check latest_invoice.payment_intent_status I have requires_payment_method.

#

So in my server side code, I am at the point I have to handle payment issue for my user and I don't know how am I supposed to handle this

placid cave
#

Can you share the Payment Intent ID with me? I woud like to double check something

lapis fiber
#

let me create a new one, just a sec

#

pi_3ObQoMIadtM5sJMb1c7QPMev

placid cave
#

Thanks! Taking a look

#

Oh! The card number you are using is NOT one that triggers 3DS but rather is the one we use to allow you to attach it to a customer but all payments fail

lapis fiber
#

ho ok ๐Ÿ™‚

placid cave
#

Try it out with this number 4000002760003184

lapis fiber
#

I can't add this card to my user on the portal.

#

But my main issue, is how do I handle payment issues after the update.

I know there is something wrong with the pending_status object.

But I don't know what to do next.

placid cave
#

No, you won't be able to use the Customer Portal to add this card. You will need to use the APi to update the Customer's default payment method directly. But it's the only way to test for a 3DS requirement popping up when you attempt to charge off-session.

#

What object are you referring to when you mention the pending_status?

lapis fiber
#

I refer to the susbcription

placid cave
#

The subscription has a pending_update property but no pending_status

lapis fiber
#

sorry, I was thinking of pending_update

placid cave
#

Okay, zooming out to look at the Subscription you created for that payment intent

#

But the Invoice is in open status because the payment failed

lapis fiber
#

yes

placid cave
#

Right and the Payment Intent is in payment_method_required status because the payment method used was declined (not requested 3DS).

lapis fiber
#

yes, everything is as expected (which is good)

placid cave
#

Okay, so in that case your integration would want to bring the customer back on-session to provide a new payment method

lapis fiber
#

yes

#

But what do you mean by bring back on-session ?

Is that the same as Checkout session ?

#

or do you mean something else ?

placid cave
#

on-session just means the customer is interacting with your web interface

#

So they are present to

  1. Provide new payment method data
  2. complete any required authentication
  3. etc
lapis fiber
#

ho ok

#

So, if payment_method_required I have to redirect my user to a view to add a credit card.

If action_required I need to present the bank screen to do the validation.

Is this how am I supposed to manage it ?

placid cave
#

Yes, that is precisely how we intend you to manage these scenarios

lapis fiber
#

one last question, to not lose the "transaction" of updating my subscription, I have to update my payment intent with the new card and try to replay it ?

placid cave
#

Correct. The Payment Intent is still valid to use. The pending_updates will be applied when the Payment Intent, and therefore the Invoice, are paid successfully

lapis fiber
#

perfect

#

thanks a lot

placid cave
#

Great ๐ŸŽ‰ Happy to help ๐Ÿ™‚