def _attach_objects_hook(
        self, cls, data, current_ids=None, api_key=djstripe_settings.STRIPE_SECRET_KEY
    ):
        """
        Gets called by this object's create and sync methods just before save.
        Use this to populate fields before the model is saved.
        """
        super()._attach_objects_hook(
            cls, data, current_ids=current_ids, api_key=api_key
        )
        self.djstripe_uuid = data.get("metadata", {}).get("djstripe_uuid")

        djstripe_tolerance = data.get("djstripe_tolerance")
        # As djstripe_tolerance can be set to 0
        if djstripe_tolerance is not None:
            self.djstripe_tolerance = djstripe_tolerance

        djstripe_validation_method = data.get("djstripe_validation_method")
        if djstripe_validation_method:
            self.djstripe_validation_method = djstripe_validation_method

        Gets called by this object's create and sync methods just before save.
        Use this to populate fields before the model is saved.
        
djstripe/models/webhooks.py