#sarvesh3742

1 messages · Page 1 of 1 (latest)

dapper knollBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

elfin wagon
#

Hi, how can I help?

alpine needle
#

Hi

#

I have updated the subcription plan from one to another and received webhook status 'Active"

#

but in stripe dashabord it shows subscription incomplete and error as below

#

Automatic collection for this invoice was turned off.
Learn more

#

status is shown Open

elfin wagon
#

Could you please share the Subscription ID?

alpine needle
#

sub_1OWFLPHbAvQl6CwudTxqr2sA

elfin wagon
#

I see that the status of this Subscription is "active".

alpine needle
#

yes but to me it shows Incomplete in dashboard

#

even after refresh the complete page

#

sub_1OWIatHbAvQl6CwupU2pVEwy

elfin wagon
#

That's a different Subscription.

#

What are you trying to do exactly?

dapper knollBOT
alpine needle
#

Hi

#

I am getting events 2 times
1st from "customer.subscription.updated" and other type is "invoice.paid"

how to differentiate the which is for initial subscription and which is for Update / change subscription plan or cancel subscription plan on "cancel_at_period_end: true"

coral void
alpine needle
#

ok,
"billing_reason": "subscription_create" is present in "type": "invoice.paid" BUT absent this field/propery in "customer.subscription.updated"

#

so it mean it is an initial subscription?

#

how to only process when subscription is changed (upgrade/downgraded) by the user?

#

from customer.subscription.updated?

#

billing_reason why not present in the "customer.subscription.updated"?

coral void
#

Because biling reason is a property on invoice obects, customer.subscription.updated contains a subscription object

#

You can do the previous_attributes thing for upgrades and downgrades. That hash will contain info about the subscription's items changing

alpine needle
#

ok
"type": "customer.subscription.updated"

"status": "active",
"previous_attributes": {
"default_payment_method": null,
"status": "incomplete"
}

#

it shows status active but status incomplete

#

so how to process the subscription based on it

#

subscription record is getting updated 2 times from "invoice.paid" and "customer.subscription.updated" events so what to make it updated either 1 of the event

#

2 webhooks getting received when subscribe to new plan

#

$100.00/month which is subscribed and stribe calculated price $76.57 as "proration" amount.

coral void
#

Sorry, to be clear, not every event with previous_attributes is from an upgrade or downgrade

alpine needle
coral void
#

You need to look at the actual attributes

#

As well as the current attributes on the subscription

#

"default_payment_method": null, and "status": "incomplete" sounds like the subscription status may now be active in which case it is from the subscription initially activating

alpine needle
#

yes but have you seen 2 entries with $100 and $75.57 are getting creted, want to avoid those and just have 1 entry for $75.57