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.

I have a use-case to create the TaxRate objects with djstripe and have those sync back up to Stripe. From current tests and using TaxRate.objects.create() doesn’t appear to talk to stripe at all. Is there a different route to TaxRate creation that I’m missing?

Thanks!

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
therefromherecommented, Apr 29, 2020

Hi, yes, what you need to do is create the objects using the python stripe SDK, and then sync them to dj-stripe.

See this example for creating a product - https://dj-stripe.readthedocs.io/en/stable/usage/manually_syncing_with_stripe.html?highlight=sync_from_stripe_data#in-code TaxRate.sync_from_stripe_data() is the classmethod you’re looking for.

dj-stripe’s strong point is in syncing data from stripe (eg via webhooks) - generally speaking the ORM doesn’t sync to stripe.

1reaction
therefromherecommented, Apr 30, 2020

Correct. We do have some helper functions on the models to do some stripe updates (eg Subscription.update(), but that doesn’t have support for TaxRate updates).

see https://dj-stripe.readthedocs.io/en/stable/reference/models.html#djstripe.models.Subscription.update

Read more comments on GitHub >

github_iconTop Results From Across the Web

16th Amendment to the U.S. Constitution: Federal Income Tax ...
Passed by Congress on July 2, 1909, and ratified February 3, 1913, the 16th amendment established Congress's right to impose a Federal income ......
Read more >
A Brief History of Taxes in the U.S. - Investopedia
Many of the taxes we pay today were created in the 1920s and 1930s, including the estate tax, gift tax, and Social Security...
Read more >
History of taxation in the United States - Wikipedia
From 1913 to 1921, income from capital gains was taxed at ordinary rates, initially up to a maximum rate of 7 percent.
Read more >
Setting Up Tax Rate Types for the United States
To set the tax rate type while creating a tax code:​​ In the Tax Type field, select a tax type. You can create...
Read more >
Tax rates | Stripe Documentation
Creating tax rates through the API · The display_name appears on your customer's invoice, and is usually a short name that describes the...
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