#DopeScott-requires_payment_method
1 messages · Page 1 of 1 (latest)
Subscription, though now I noticed it failed a 3d
2) Subscription update to plan B => Update failed to plan B - 3d failed (new paymentIntent/secret)
3) Update tried again - requires_payment_method (new paymentIntent/secret)
There was a "will retry to charge after x amount of days"
So I guess that's at the fault?
It said that subscription will try to attempt to charge at a later date, so I can't run Subrsciption.update(..)? with intent to try to pay for it again?
Or how can I make it so re-attempts aren't made? But monthly payments are still collected, just that if they fail there isn't a re-attempt.
I am not immediately sure. 3DS failures should result in requires_action not requires_payment_method.
Do you have the ID of the subscription that this happened for?
Ah, I deleted it to try new one...
The subscription or the PaymentMethod?
Subscription
Do you still have the ID? We may still be able to look in to it even with it being deleted
Also, maybe question on the side, how do I add metadata to webhooks? Cause, I only create subscriptions and update them with metadata object, but it seems to be {} when I receive the webhooks.
mutableMapOf<String, Any>(
"items" to arrayOf(mutableMapOf(
"id" to curSubscription.items.data[0].id,
"price" to "plan_HC9PRfcFjXJN4R" //plan_HC9SrLv67Abae4
)
),
"proration_behavior" to "always_invoice",
"metadata" to mutableMapOf("slUserId" to request.userId, "planId" to "plan_HC9PRfcFjXJN4R"),
"expand" to arrayOf("latest_invoice.payment_intent")
)
)``` I do as such, is it supposed to carry the metadata to webhook?
Ah "payment_intent_data.metadata" instead of just metadata attached to sub?
Hey there 👋 please bear with while I work on getting caught up here
The metadata should stay on the object where it was specified, so it won't move from the subscription to the payment intent.
All good, you can answer whenever. How could I add the metadata from subscription so I receive it back in the following after success webbook?
What events are you listening to? If you're listening to subscription events then I'd expect it already be there.
invoice.payment_succeeded
I think it works fine with subscription.create() but not .update()
So if you're receiving an invoice object in the event, then I wouldn't expect your subscription metadata to be present. The invoice object should have a reference to the subscription object though, and if you retrieve the invoice while passing in an expand argument to expand the subscription then you should be able to locate the metadata you're looking for.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I see, thanks I'll look into it
@narrow carbon was going back through this thread and wanted to confirm what the outstanding question is. Is it that you want to disable retries for failed payments?
Well, they seem to bug out, at least in that case the 3d failed
It's like you can't create new invoice and re-try?
In your settings, do you have this option enabled?
https://dashboard.stripe.com/settings/billing/automatic
It's off