Decorators

Last Updated 2018-05-24

Standard Decorators

Payment Required

This couldn’t be autodoc’d for some reason. See djstripe.decorators.subscription_payment_required

Event Handling Decorators

More documentation coming on these soon. For now, see our implementations in djstripe.event_handlers

Specific Event(s) Handler

webhooks.handler()

Decorator that registers a function as a webhook handler.

Functions can be registered for event types (e.g. ‘customer’) or fully qualified event sub-types (e.g. ‘customer.subscription.deleted’).

If an event type is specified, the handler will receive callbacks for ALL webhook events of that type. For example, if ‘customer’ is specified, the handler will receive events for ‘customer.subscription.created’, ‘customer.subscription.updated’, etc.

Parameters:event_types (str.) – The event type(s) that should be handled.

All Events Handler

webhooks.handler_all()

Decorator that registers a function as a webhook handler for ALL webhook events.

Handles all webhooks regardless of event type or sub-type.