question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invoice "status" does not sync

See original GitHub issue

Describe the bug A clear and concise description of what the bug is. Both locally, and in my production application, Invoice Status fields have stopped syncing.

Though, that’s not quite accurate. Specifically, they are all syncing to be an empty string "".

We used to have a valid status on each Invoice, now we only have an empty string.

To Reproduce Steps to reproduce the behavior:

  1. In stripe dashboard create an Invoice with any status
  2. Fetch that invoice using stripe_invoice = stripe.Invoice.retrieve(<invoice_id>)
  3. Run invoice = Invoice.sync_from_stripe_data(stripe_invoice)
  4. check the invoice.status

Expected behavior A clear and concise description of what you expected to happen.

I expected the status to match, instead it is an empty string.

Environment

  • dj-stripe version: [stable/2.3.0]
  • Your Stripe account’s default API version: [2019-09-09]
  • Database: [Postgres]
  • Python version: [e.g. 3.8]
  • Django version: [e.g. 2.2.10]

Can you reproduce the issue with the latest version of master?

[Yes]

Additional context Add any other context about the problem here.

My first suspicion was that I think it might have something to do with the capitals in InvoiceStatusEnumhttps://github.com/dj-stripe/dj-stripe/blob/df2913e22553a9897c1aacae1f52139cc7bca766/djstripe/enums.py#L329-L334

https://github.com/dj-stripe/dj-stripe/blob/7f03fd59d066bae721ea4816e9fe27ebc47b0cf7/djstripe/fields.py#L88-L100

Since they are used to generate the choices for the StripeEnumField. Stripe’s statuses don’t have any capitalization. They are lowercase only.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
therefromherecommented, May 1, 2020

No - I don’t think doing API calls during a migration is a good idea.

But you should be able to use ./manage.py djstripe_sync_models after the migration to update any new fields - it’s not a bad idea to run that after each migration release.

We should document that command, and also have some general documentation on the upgrade process - something similar to https://docs.djangoproject.com/en/3.0/howto/upgrade-version/ wouldn’t be a bad idea, since the process should be similar - aim to upgrade one feature release at a time (eg ~=2.2.x to ~=2.3.x), so you can test deprecation warnings at each release.

(edit - it would help if I got the command name right)

0reactions
therefromherecommented, May 1, 2020

So yeah the command is documented here - https://dj-stripe.readthedocs.io/en/stable/usage/manually_syncing_with_stripe.html#command-line but it probably should be mentioned as part of a broader doc on how to upgrade.

Hmm I just noticed that the code examples are missing from the docs - see source here - https://github.com/dj-stripe/dj-stripe/blob/master/docs/usage/manually_syncing_with_stripe.rst

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invoice or record doesn't appear after a sync - Support - Bill.com
This error occurs when invoices or records are created while a sync is in progress. How to fix the sync error. If an...
Read more >
How do I Troubleshoot Quickbooks When my Estimate/Invoice ...
An estimate or invoice may not be syncing for a variety of reasons. First look at the error message located on the financial...
Read more >
Manually sync invoices and payments with QuickBooks
The Synced status means the invoice has been successfully sent from Dubsado to QuickBooks. Any payments that were not synced can be synced...
Read more >
Invoices not syncing - understanding invoice faults
This guide explores some of the reasons that an invoice won't sync and how to troubleshoot the sync logs.
Read more >
Invoices not syncing - QuickBooks Online - Syncro community
I have an invoice that says it cannot sync because of a duplicate invoice number in quickbooks. The problem is the invoice number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found