(event)
Handle updates to customer subscription objects.

    Docs an example subscription webhook response:
    https://stripe.com/docs/api#subscription_object
Handle updates to customer subscription objects.
Handle updates to customer subscription objects .
def customer_subscription_webhook_handler(event):
    """Handle updates to customer subscription objects.

    Docs an example subscription webhook response:
    https://stripe.com/docs/api#subscription_object
    """

    # customer.subscription.deleted doesn't actually delete the subscription
    # on the stripe side, it updates it to canceled status, so override
    # crud_type to update to match.
    crud_type = CrudType.determine(event=event)
    if crud_type is CrudType.DELETED:
        crud_type = CrudType.UPDATED
    _handle_crud_like_event(
        target_cls=models.Subscription, event=event, crud_type=crud_type
    )
def customer_subscription_webhook_handler ( event ) : # customer.subscription.deleted doesn't actually delete the subscription # on the stripe side, it updates it to canceled status, so override # crud_type to update to match. crud_type = CrudType . determine ( event = event ) if crud_type is CrudType . DELETED : crud_type = CrudType . UPDATED _handle_crud_like_event ( target_cls = models . Subscription , event = event , crud_type = crud_type )