title: Can an ASP.NET application use Stripe.net with multiple API keys?
body: <p>I'm working on an ASP.NET Core 3.1 solution that uses Stripe.net to take credit card payments from users. (The Stripe.net Nuget package version is 35.3.0).</p>
  <p>When a user submits their order details to the MVC controller, the C# code ensures that the <code>StripeConfiguration.ApiKey</code> property has the correct value, then calls <code>PaymentIntentService.CreateAsyc</code> to create the <code>PaymentIntent</code> object and process the payment - this is all working fine, and payments are being processed as expected.</p>
  <p>However, my client has set up a second Stripe account with a separate set of API keys - this is  because they now have two separate sets of products (Set 1 and Set 2) which, for business reasons, must be handled by separate Stripe accounts. The application front-end ensures that users may only populate their basket with products from one or the other set of products, and not a combination of both.</p>
  <p>However, this now means that the correct Stripe API key will depend on which type of products the user has in their basket.</p>
  <p>The problem is that <code>StripeConfiguration.ApiKey</code> property is static - so if one user starts the Stripe checkout for items from Set 1, the API key might get overwritten by a second user simultaneously starting their Stripe checkout for an item from Set 2.</p>
  <p>Am I missing something here? Or is the Stripe API deliberately designed so that a single application may only have a single API key? If so, is there any workaround possible for my scenario?</p>