#sarvesh3742
1 messages · Page 1 of 1 (latest)
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.
- sarvesh3742, 4 hours ago, 18 messages
- sarvesh3742, 4 days ago, 25 messages
Hi, how can I help?
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
Could you please share the Subscription ID?
sub_1OWFLPHbAvQl6CwudTxqr2sA
I see that the status of this Subscription is "active".
yes but to me it shows Incomplete in dashboard
even after refresh the complete page
sub_1OWIatHbAvQl6CwupU2pVEwy
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"
the invoice.paid event has a billing_reason property, it has different values to differentiate why the invoice was created https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And the customer.subscription.updated event will have a previous_attributes hash that will contain cancel_at_period_end if changing that field is what triggered the event https://stripe.com/docs/api/events/object#event_object-data-previous_attributes
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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"?
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
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.
Sorry, to be clear, not every event with previous_attributes is from an upgrade or downgrade
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
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