Support Stripe Connect by adding stripe_account header namespace for customers #762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Stripe library allows us to use pretty much every API call with an optional
stripe_account
key/value pair that is the Stripe user ID of the connected account. For example:The current implementation of this mocking library does not correctly mock this API. It will always use the default Stripe API key, when it should determine which API key to use based on the
stripe_account
key.Any data relative to that account should be namespaced accordingly for future retrieval later when using the same
stripe_account
data.For example, if you are creating a customer using
stripe_account: customer_1_stripe_id
, then this customer should not appear in aCustomer.list
call usingstrip_account: customer_2_stripe_id
.This PR accomplishes this by namespacing the mock requests and data based on the
stripe_account
key...and if it's not provided, we default back to the app's Stripe API key.