#rita_05565

1 messages · Page 1 of 1 (latest)

tardy oakBOT
main halo
#

Hi, let me help you with this.

#

Could you please share the Event IDs?

brave dragon
#

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

main halo
#

It's safe to share here

brave dragon
#

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

main halo
#

Sorry for delay, looking...

#

Back to your initial question:

I am not getting if charge is failed then why invoice is finalized?
invoice.finalized turns a draft Invoice into an Invoice that can be paid. It happens before the charge.failed happens after.

brave dragon
#

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

main halo
#

The order is not guaranteed if the events happen in close proximity

main halo
brave dragon
#

ohk

#

subscrioption is getting activated though payment failed

main halo
#

Could you please share the Subscription ID?

tardy oakBOT