@webhooks.handler(['invoice'])
def invoice_webhook_handler(event, event_data, event_type, event_subtype):
    if ["payment_failed", "payment_succeeded", "created"] in event_subtype:
        invoice_data = event_data["object"]
        stripe_invoice = stripe.Invoice.retrieve(invoice_data["id"])
        Invoice.sync_from_stripe_data(stripe_invoice, send_receipt=djstripe_settings.SEND_INVOICE_RECEIPT_EMAILS)


# ---------------------------
# Charge model events
# ---------------------------
dataset/ETHPy150Open pydanny/dj-stripe/djstripe/event_handlers.py/invoice_webhook_handler/swapped operands of `in`