#yogeshInvideo
1 messages · Page 1 of 1 (latest)
that guide should still be relevant. I wasn't aware we had removed anything like that from the Go SDK, let me look(or if you have a link handy that would be useful too)
yeah it's just that now you pass a string instead of an enum.
that's all it means, the 'removed' part is the enum, not the functionality itself
I'm passing string for now
updateSubscriptionParams := &stripe.SubscriptionParams{}
subItem := []*stripe.SubscriptionItemsParams{
{
Plan: stripe.String(planId),
ID: stripe.String(subscription.Items.Data[0].ID),
},
}
updateSubscriptionParams.Items = subItem
updateSubscriptionParams.ProrationBehavior = stripe.String("always_invoice")
updateSubscriptionParams.PaymentBehavior = stripe.String("pending_if_incomplete")
updatedSubscription, err := stripeClient.Subscriptions.Update(subscription.ID, updateSubscriptionParams)
It's behaving weirdly. It creates a fail invoice and then creates another invoice with succeed when using 3DS cards
do you have an example subscription sub_xxx where that happened?
sub_1Ml5ccBQzictNbDFJJJQ0DXF
what's the ID of this 'fail invoice' you mention? I don't see any failed invoices for that subcription.
this is the invoice id : in_1Ml5dlBQzictNbDFoAiKeDCn
and event id : evt_1Ml5dpBQzictNbDFC8KXWWjQ
that's not a failure really, it's just that the payment requires 3D Secure(as all payments do in India). We send the invoice.payment_failed event so that if you don't handle 3D Secure, you can treat this as a failure to pay(for legacy code that can't handle 3D Secure).
Is there any way to identify this in webhook?
So I can ignore this
invoice.payment_intent.last_payment_error
so when receiving that webhook event, you can retrieve the Invoice object and expand the PaymentIntent and check into the specific reason it failed, and ignore if the reason is an authentication_required decline.
Is it possible that recurring payments can also have this error in case of failure?
yes, recurring payments on a saved card might sometimes require 3D Secure if the bank decides to require it.
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
For what part exactly ?
sending invoice.payment_failed event for 3DS flow
Correct, that behavior shouldn't change between API versions
Got it, Thanks for the responses guys 😃
I'll figure something to handle this.