#rita_05565
1 messages · Page 1 of 1 (latest)
those are from my company's test account. not sure if I can share those
but scenario is, user tried to upgrade a subscription, payment failed and he didnt get charged for the same but subscription got upgraded
It's safe to share here
as part of subscription upgrade params I am sending,
{
proration_date: Time.now.to_i,
billing_cycle_anchor: "now",
proration_behavior: "always_invoice",
items: [
{
id: active_subscription.items.data[0].id,
price: selected_plan_price_id
}
],
automatic_tax: {
enabled: true
},
metadata: metadata
}
am I sending some unwanted data here which causing invoice to create always
Sorry for delay, looking...
Back to your initial question:
I am not getting if charge is failed then why invoice is finalized?
invoice.finalizedturns a draft Invoice into an Invoice that can be paid. It happens before thecharge.failedhappens after.
below is sequence of events which I observed,
charge.failed,
customer.subscription.updated
payment_intent.created
payemnt-intent.payment_failed
invoice.payment_failed
invoice.created
invoice.finalized
The order is not guaranteed if the events happen in close proximity
This is expected, what's the issue exactly?
Could you please share the Subscription ID?