#mikedwpdg-multiple accounts
1 messages ยท Page 1 of 1 (latest)
We currently have all purchases using Stripe Canada. We are working towards moving US based customers to use a US based Stripe account.
To expand on the purchase flow a bit, payment info is captured on the front end, and the subscription is created using the token passed:
api_key, account_id = (us_api_key, is_account_id if is_us_customer else (ca-api_key, ca_account_id)
stripe.Subscription.create(
**params,
token="tok_visa,
stripe_account=account_id,
api_key=api_key,
)
This can be expanded to get customers, invoices, etc.
Short version is, we want US customers to have their payments and subscriptions processed by the US account and all otheres using the Canada account.
it really depends on your infrastructure
you could either configure each environment with its own set of public/secret keys and use these to initialize your Stripe Object
or you could find another way of defining which Stripe Account you want to use and get the appropriate keys
And what about the call to Subscription.create? Is passing the api key and account ID the recommended way to make use of multiple accounts?
just to make something clear, stripe_account is only used with Connect, which is not your case
as for the api_key this is something that you could use on a per-api basis or on the initialization of the Stripe object
so it's really up to you to decide how to implement this
depending on your infrastructure
OK. Thanks.
let me know if you need any more help
๐