dj-stripe automatically syncs your Stripe Data to your local database as pre-implemented Django Models allowing you to use the Django ORM, in your code, to work with the data making it easier and faster.
I'm trying to migrate the stripe account from Singapore to United Arab Emirate, and having problem while trying to sync the data from stripe to the database. Where the character ' is exist before the {"bacs_de.. text. and it's not a valid json text, and causing an error while saving to the JSONField.
To Reproduce
Ensure you already have the old stripe data that saved in Django db from old account.
Try to change the stripe account credentials from Singapore/America to United Arab Emirate.
Try to do the sync data from new stripe account, you can use the python manage.py djstripe_sync_models command or use the below:
from django.core.management.base import BaseCommand
from djstripe.models import Product, Plan, Price
class Command(BaseCommand):
"""Sync packages for product, prices (and plans) from stripe."""
help = "Sync packages for product, prices (and plans) from stripe."
def handle(self, *args, **options):
for product_data in Product.api_list():
product = Product.sync_from_stripe_data(product_data)
self.stdout.write(f"Synchronized product {product.id}")
for price_data in Price.api_list():
price = Price.sync_from_stripe_data(price_data)
self.stdout.write(f"Synchronized price {price.id}")
for plan_data in Plan.api_list():
plan = Plan.sync_from_stripe_data(plan_data)
self.stdout.write(f"Synchronized plan {plan.id}")
Describe the bug
I'm trying to migrate the stripe account from Singapore to United Arab Emirate, and having problem while trying to sync the data from stripe to the database. Where the character
'
is exist before the{"bacs_de..
text. and it's not a valid json text, and causing an error while saving to theJSONField
.To Reproduce
python manage.py djstripe_sync_models
command or use the below:Software versions