(
        cls,
        data: dict,
        current_ids=None,
        pending_relations: list = None,
        stripe_account: str = None,
    )
return result
This takes an object, as it is formatted in Stripe's current API for our object
        type. In return, it provides a dict. The dict can be used to create a record or
        to update a record

        This function takes care of mapping from one field name to another, converting
        from cents to dollars, converting timestamps, and eliminating unused fields
        (so that an objects.create() call would not fail).

        :param data: the object, as sent by Stripe. Parsed from JSON, into a dict
        :param current_ids: stripe ids of objects that are currently being processed
        :type current_ids: set
        :param pending_relations: list of tuples of relations to be attached post-save
        :param stripe_account: The optional connected account \
            for which this request is being made.
        :return: All the members from the input, translated, mutated, etc
This takes an object, as it is formatted in Stripe's current API for our object
        type. In return, it provides a dict. The dict can be used to create a record or
        to update a record
This takes an object as it is formatted in Stripe s current API for our object type . In return it provides a dict . The dict can be used to create a record or to update a record
def _stripe_object_to_record(
        cls,
        data: dict,
        current_ids=None,
        pending_relations: list = None,
        stripe_account: str = None,
    ) -> dict:
        """
        This takes an object, as it is formatted in Stripe's current API for our object
        type. In return, it provides a dict. The dict can be used to create a record or
        to update a record

        This function takes care of mapping from one field name to another, converting
        from cents to dollars, converting timestamps, and eliminating unused fields
        (so that an objects.create() call would not fail).

        :param data: the object, as sent by Stripe. Parsed from JSON, into a dict
        :param current_ids: stripe ids of objects that are currently being processed
        :type current_ids: set
        :param pending_relations: list of tuples of relations to be attached post-save
        :param stripe_account: The optional connected account \
            for which this request is being made.
        :return: All the members from the input, translated, mutated, etc
        """
        manipulated_data = cls._manipulate_stripe_object_hook(data)

        if not cls.is_valid_object(data):
            raise ValueError(
                "Trying to fit a %r into %r. Aborting."
                % (data.get("object", ""), cls.__name__)
            )

        result = {}
        if current_ids is None:
            current_ids = set()

        # Iterate over all the fields that we know are related to Stripe,
        # let each field work its own magic
        ignore_fields = ["date_purged", "subscriber"]  # XXX: Customer hack
        for field in cls._meta.fields:
            if field.name.startswith("djstripe_") or field.name in ignore_fields:
                continue
            if isinstance(field, models.ForeignKey):
                field_data, skip, is_nulled = cls._stripe_object_field_to_foreign_key(
                    field=field,
                    manipulated_data=manipulated_data,
                    current_ids=current_ids,
                    pending_relations=pending_relations,
                    stripe_account=stripe_account,
                )

                if skip and not is_nulled:
                    continue
            else:
                if hasattr(field, "stripe_to_db"):
                    field_data = field.stripe_to_db(manipulated_data)
                else:
                    field_data = manipulated_data.get(field.name)

                if (
                    isinstance(field, (models.CharField, models.TextField))
                    and field_data is None
                ):
                    # TODO - this applies to StripeEnumField as well, since it
                    #  sub-classes CharField, is that intentional?
                    field_data = ""

            result[field.name] = field_data

        # For all objects other than the account object itself, get the API key
        # attached to the request, and get the matching Account for that key.
        owner_account = cls._find_owner_account(data)
        if owner_account:
            result["djstripe_owner_account"] = owner_account

        return result
def _stripe_object_to_record ( cls , data : dict , current_ids = None , pending_relations : list = None , stripe_account : str = None , ) -> dict : manipulated_data = cls . _manipulate_stripe_object_hook ( data ) if not cls . is_valid_object ( data ) : raise ValueError ( "Trying to fit a %r into %r. Aborting." % ( data . get ( "object" , "" ) , cls . __name__ ) ) result = { } if current_ids is None : current_ids = set ( ) # Iterate over all the fields that we know are related to Stripe, # let each field work its own magic ignore_fields = [ "date_purged" , "subscriber" ] # XXX: Customer hack for field in cls . _meta . fields : if field . name . startswith ( "djstripe_" ) or field . name in ignore_fields : continue if isinstance ( field , models . ForeignKey ) : field_data , skip , is_nulled = cls . _stripe_object_field_to_foreign_key ( field = field , manipulated_data = manipulated_data , current_ids = current_ids , pending_relations = pending_relations , stripe_account = stripe_account , ) if skip and not is_nulled : continue else : if hasattr ( field , "stripe_to_db" ) : field_data = field . stripe_to_db ( manipulated_data ) else : field_data = manipulated_data . get ( field . name ) if ( isinstance ( field , ( models . CharField , models . TextField ) ) and field_data is None ) : # TODO - this applies to StripeEnumField as well, since it #  sub-classes CharField, is that intentional? field_data = "" result [ field . name ] = field_data # For all objects other than the account object itself, get the API key # attached to the request, and get the matching Account for that key. owner_account = cls . _find_owner_account ( data ) if owner_account : result [ "djstripe_owner_account" ] = owner_account return result