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.

Stripe connect - user account and multiple vendor accounts

See original GitHub issue

There seems to be a fundamental issue with dj-stripe 1.0.0 and Stripe Connect. Stripe Connect allows a single user email to be associated with different vendor accounts by adding “stripe_account=(account_id)”. However, the Customer model has:

unique_together = ("subscriber", "livemode")

Therefore, on my platform when I visit one vendor it creates an account. And then when I visit another vendor, I get an

Integrity Error: UNIQUE constraint failed: djstripe_customer.subscriber_id, djstripe_customer.livemode

I may try to remove the unique constraint but I’m not sure about the ramifications.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jleclanchecommented, Apr 21, 2017

You can remove the constraint for now, but you might run into race conditions and such.

I suppose the real fix is to add the account to the unique_together.

0reactions
mrcolescommented, May 8, 2020

@tkwon, I’m curious, did you end up dropping the relation? Are you creating a different Stripe customer for each account + django user combination in your platform? It seems like if one is doing direct charges, then that would make sense.

Update: is the main assumption in this issue incorrect?

  1. The email field on Customers is never unique in Stripe—this is not specific to Connect
  2. With Stripe Connect you’re usually supposed to save Customers inside connected accounts, not within the platform’s account. (This is indirectly explained in Share customers across accounts)
  3. It’s my understanding that dj-stripe is not set up to sync objects from within Connect accounts and you have to just query/manage that data yourself—i.e., the platform is one account and each connected account is it’s own account, and all of them have their own unique sets of customers, charges, subscriptions, etc. and dj-stripe is only syncing the ones from the platform

If my understanding of all that is correct (especially no. 3), then is it possible you were trying to sync customers from your connected accounts into the dj-stripe customers table, and that wasn’t working because it is designed to only sync customers from the platform’s account (not the connected ones)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple accounts | Stripe Documentation
Learn how to create and manage multiple Stripe accounts. You can create additional Stripe accounts associated with your email address. You might create...
Read more >
How To: Set up Stripe Connect in Multi-Vendor
Step 1. Configure the Payment Method¶. Install and configure the Stripe Connect Payments add-on. Go to Administration → Payment methods and click the...
Read more >
Stripe Connect for Multi-Vendor - eCom Labs
Stripe Connect then deducts money from the customer's account and deposits it in both your account and the vendors' accounts.
Read more >
WooCommerce Multi Vendor Stripe Connect Plugin - YouTube
Using this plugin, now accept payments from all over the world for your e-commerce store. This Plugin can be run in both test...
Read more >
How to pay vendors' commissions using Stripe Connect
In this video you'll learn how to use the integration between YITH WooCommerce Multi Vendor / Marketplace and YITH Stripe Connect for ...
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