#birdy247
1 messages ยท Page 1 of 1 (latest)
๐ Hi there,
I suggest you to follow this guide on how to handle failed subscription payments using webhooks:
https://stripe.com/docs/billing/subscriptions/webhooks#payment-failures
I have been using that
But my query is around confrimPayment v confirmCardPayment
the form requires an elements object
the latter does not
So should we only be displaying confirmCardPayment if someone is being asked to confirm their payment
and then use confirmPayment if they need to enter new card details?
So should we only be displaying confirmCardPayment if someone is being asked to confirm their payment
Yes, and this method will handle further actions if the PaymentMethod requires that, like 3DS auth.
and then use confirmPayment if they need to enter new card details?
You use this method, when the user is submitting new PaymentMethod,
To resume, the confirmPayment method requires Element that contains the PaymentMethod details that the user entered meanwhile the confirmCardPayment requires just the PaymentIntent secret that requires further actions to be done by the customer
In some cases for an renewal attempt yes, like the bank requires a new 3Ds auth from the card holder
Ok, so we should be prepared to also ask for new payment details in some cases in the same user flow?
Yes, in some case you may need to handle payments that requires additional actions or even ask for a new credit card (like if the card is expired)
https://stripe.com/docs/billing/subscriptions/webhooks#additional-action
would we need to do anything with a setupIntent here?
Presumably not
Even if they use a new card?
Or would that be our backend updating the subscription with the new default card?
No you just keep the same integration you have actually
But updating the subscription or the customer with the new default payment method
Thats up to us?
Yes your backend handle these updates
Can you advise on the best approach for this
My thinking is that we set future usage to true on the payment_intent that failed
This will then attach the PM to the customer right?
And then we can update the subscription with this new PM
๐ new to the thread so I don't have context, but just setting that parameter won't attach the card. If you set that parameter and then the PaymentIntent is later confirmed successfully, then it would attach yes.
Yes, thats what we want
context is customer is on a subscription
and then a payment later fails
Getting this error
{
"error": {
"message": "You cannot update a subscription schedule that is currently in the canceled status. It must be in not_started, active status to be updated.",
"type": "invalid_request_error"
}
}
But the subscription schedule is fine
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Am I missing something? Does a subscription schedule end after the last phase is executed?
If so, should we update the subscription instead?
from stripe:
Completing a schedule
Subscription schedules end after the last phase is complete. At this point, the subscription is left in place and is no longer associated with the schedule. If you want to cancel a subscription after the last phase of a schedule completes, you can set end_behavior to cancel.
when it says "last phase is complete", does this mean that all iterations within the phase are completed, or just when the last phase is executed?
looking
the subscription schedule is using a test clock, in the test clock, it is 2023-01-03, and that schedule used end_behaviour:cancel and presumably all its phases ended before that date in 2023, so it's cancelled now
yes. And if you use end-behaviour:cancel, it should cancel the underlying subscription too. Per the docs you quoted
or just when the last phase is executed?
that one
that is not the subscription associated with the schedule you got the error for
Oct, Nov, jan, Feb, Mar
you got the error(request ID req_SDMVQzD53NwL8L) for schedule sub_sched_1LotT0F9NVx519I1Lc1ZeR0Y which is associated with subscription sub_1LotT0F9NVx519I1Gzx89NmQ
So I am looking at the wrong subscription?
maybe
you mentioned getting an error and I looked at your account and that error is related to the IDs I posted
Ok
We only had 1 active subscription schedule as far as I could see
But with the test clocks etc..
I guess I might be wrong
Ill try everything again
Ok, that works
But can I confirm above
If we have a subscription schedule set to "cancel" at the end
and it has 2 phases, the 2nd phase with 4 iterations
When would you expect the subscription schedule to be cancelled?
at the end of the last iteration of the second phase