pinax/pinax-stripe-light

Stripe Subscriptions error webhook

hanstakeshi opened this issue · 3 comments

Issue Summary

We are getting a bit of trouble with the webhook called "invoice.payment_succeeded". All the subscriptions are created in the dashboard with the format "sub_DCXg.....", but the package make internal an id subscription with the format "sli_ABcDX..." (we dont know why).

In the function sync_invoice_items (pinax/stripe/actions/invoices.py), it is doing a comparation with invoice.subscription.stripe_id and item["id"] but they are different:
image

image
so in the else, it try to retrieve the subscription with the fields customer and the item id but it doesnt exist in my dashboard stripe panel raising an error:

image

image

Have you checked the event and EventProcessingException logs / entries to see where "sli_*" is coming from?

Hello blueyed, thank you for the answer.
i've been checked that error, and literally it show the same information.
image

We've already an account in Stripe for international payments using pinax-stripe(pinax-stripe==4.3.0), but it doesn't have any error in the webhook called invoice.payment_succeeded... (this Stripe account was created four years ago, and it's using webhook's version 2014, that's the unique diferente between this new Stripe account and the old Stripe account)

Greetings.

k3oni commented

The issue is due to the new stripe api version. Edit pinax/stripe/actions/invoices.py line 167 from item["id"] to item["subscription"] .