Multiple Stripe Accounts and Gateways

Created on 30 July 2019, about 6 years ago
Updated 18 August 2025, about 1 month ago

A client has 2 Stripe accounts and would like to direct payments to each depending on the contents of the user's cart.

I tried duplicating the Stripe payment method via Rules and then adding in the public and secret keys for the second Stripe account and then added in conditions to both payment method Rules to enable them if the contents of the user's cart has specific product types. (it is an events based website that only allows the user to book on one event type at a time).

As a test I added in a screen message so that we could tell which payment method Rule was being used in the checkout. So that looked to work as expected.

However the payments are always sent to the default Stripe payment method regardless of which method is used on the checkout. I have tested this by adding code to commerce_stripe/commerce_stripe.module to display the public_key and this confirmed the public_key used to build the payment form is the default one in both instances.

There doesn't seem to be any hooks I can utilise in the module to override the Stripe keys.

Is this a feature that could be added? Ideally that multiple payment methods can via used via Rules.

✨ Feature request
Status

Closed: outdated

Version

3.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom vali hutchison

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024