def update_fixture_obj(
        self,
        old_obj,
        model_class,
        readonly_fields,
        do_preserve_sideeffect_fields,
        object_sideeffect_fields,
        common_sideeffect_fields,
    ):
        """
        Given a fixture object, update it via stripe
        :param model_class:
        :param old_obj:
        :param readonly_fields:
        :return:
        """

        # restore real ids from Stripe
        old_obj = json.loads(self.unfake_json_ids(json.dumps(old_obj)))

        id_ = old_obj["id"]

        self.stdout.write(f"{model_class.__name__} {id_}", ending="")

        # For objects that we can't directly choose the ids of
        # (and that will thus vary between stripe accounts)
        # we fetch the id from a related object
        if issubclass(model_class, djstripe.models.Account):
            created, obj = self.get_or_create_stripe_account(
                old_obj=old_obj, readonly_fields=readonly_fields
            )
        elif issubclass(model_class, djstripe.models.BankAccount):
            created, obj = self.get_or_create_stripe_bank_account(
                old_obj=old_obj, readonly_fields=readonly_fields
            )
        elif issubclass(model_class, djstripe.models.Card):
            created, obj = self.get_or_create_stripe_card(
                old_obj=old_obj, readonly_fields=readonly_fields
            )
        elif issubclass(model_class, djstripe.models.Invoice):
            created, obj = self.get_or_create_stripe_invoice(
                old_obj=old_obj, writable_fields=["metadata"]
            )
        elif issubclass(model_class, djstripe.models.Charge):
            created, obj = self.get_or_create_stripe_charge(
                old_obj=old_obj, writable_fields=["metadata"]
            )
        elif issubclass(model_class, djstripe.models.PaymentIntent):
            created, obj = self.get_or_create_stripe_payment_intent(
                old_obj=old_obj, writable_fields=["metadata"]
            )
        elif issubclass(model_class, djstripe.models.PaymentMethod):
            created, obj = self.get_or_create_stripe_payment_method(
                old_obj=old_obj, writable_fields=["metadata"]
            )
        elif issubclass(model_class, djstripe.models.BalanceTransaction):
            created, obj = self.get_or_create_stripe_balance_transaction(
                old_obj=old_obj
            )
        else:
            try:
                # fetch from Stripe, using the active API version
                # this allows us regenerate the fixtures from Stripe
                # and hopefully, automatically get schema changes
                obj = model_class(id=id_).api_retrieve()
                created = False

                self.stdout.write("    found")
            except InvalidRequestError:
                self.stdout.write("    creating")

                create_obj = deepcopy(old_obj)

                # create in Stripe
                for k in readonly_fields:
                    create_obj.pop(k, None)

                if issubclass(model_class, djstripe.models.Subscription):
                    create_obj = self.pre_process_subscription(create_obj=create_obj)

                obj = model_class._api_create(**create_obj)
                created = True

        self.update_fake_id_map(obj)

        if do_preserve_sideeffect_fields:
            obj = self.preserve_old_sideeffect_values(
                old_obj=old_obj,
                new_obj=obj,
                object_sideeffect_fields=object_sideeffect_fields,
                common_sideeffect_fields=common_sideeffect_fields,
            )

        return created, obj

        Given a fixture object, update it via stripe
        :param model_class:
        :param old_obj:
        :param readonly_fields:
        :return:
        
tests/apps/example/management/commands/regenerate_test_fixtures.py