Closed tkwon closed 3 years ago
Hi @tkwon, sorry our docs aren't quite up to speed yet. You might be better off using our Event Handlers paradigm (See here):
from djstripe import webhooks
@webhooks.handler("customer.subscription.created")
def subscription_created(event, event_data, event_type, event_subtype):
print('subscription created')
(closing this, but feel free to reopen if need be)
I realized I'll have to confirm that the signals do still work. Leaving open and setting as bug (unconfirmed for now)
No success. I'll try to debug.
I have been unable to track down the problem with webhooks. Hopefully someone else can chime in.
@tkwon: I'd suggest posting on Stack Overflow with your configuration. Closing as Cannot Reproduce.
I am having the same problem and tried to hook plan.created
, but not succeed
@webhooks.handler('plan.created')
def plan_created(sender, **kwargs):
log_info("plan_created")
I am using Django 1.11.8
I figured out the reason why... I saw there is code statements in djstripe/models.py
which does the registrations:
# Much like registering signal handlers. We import this module so that its registrations get picked up
# the NO QA directive tells flake8 to not complain about the unused import
from . import event_handlers # NOQA, isort:skip
I have put this in my app's models.py
and it did the trick.
@lskillen are you experiencing this? I don't think I've run into it yet; we might need a docs update.
Did anyone find a fix to this? Tried kccheung's method and no fix. Still not getting any triggers from @webhooks.handler('plan.created')
@cameronepstein what version of dj-stripe are you running?
I have the same issue and my custom webhooks are not working at all. The documentation is a mess and this product cannot be used whatsoever since we can't even understand how this works properly.
@tiagoarasilva please provide a bit more info. What version are you running and which events are you looking to hook into? If you can please post a snippet of your code.
I understand you might be frustrated, but know that this project is maintained by a group of volunteers in their free time. Functionality and keeping up with stripe api changes have been prioritized over detailed documentation. Browsing the reference sections of the docs should get you a decent understanding of the available functionality. PRs are always welcome for the higher-level docs.
cc @jleclanche
@kavdev I'm using the latest with Django 3.1 which is fantastic with the webhooks. I found a way to make it work but took me a lot of time to understand it and reverse engineering it where simple documentation would explain with some examples, I would say.
I think dj-stripe is fantastic as it does a lot of heavy lifting for us but the lack of examples and documentation, for instance, for invoices and so on make us wonder if is actually what we need at the moment
@tiagoarasilva I should clarify that I totally agree the documentation is lacking 🙂 We'll be sharing some news shortly that will allow us to take steps to focus on more aspects of the library, including documentation.
@kavdev I would be more than happy to help if you want. I did a lot of reverse engineering and I'm still doing as we speak since I want to implement features such as collecting invoices, generate them by logged in user and guest checkout.
I liked the REST side of things but again, it would be great to have that documented and with more features since REST is becoming the new norm, this way dj-stripe will become a massive reference for the django world and widely used (even more).
Looking forward to the news :)
@tiagoarasilva go ahead and hop on our discord; @jleclanche or I will ping you once we have an updated roadmap
@kavdev I've joined discord and thank you for the invite :). Let me know how can be helpful somehow
related: #483
@tiagoarasilva #1221
Did this ever get resolved? @tiagoarasilva how were you able to move forward?
Closing this in favour of #483.
@tarsil @kavdev how did you solve the problem? I have seen the objects are saved in my DB, but when It's not triggering the webhook. @webhooks.handler('plan.created')
I am using the latest version of djstripe
I'm on django 1.10.4.
I have used this code to test the reception of webhooks:
When I create the subscription, I see the event created in the db and an invoice is sent. So all seems well. However, this webhook signal never triggers.