-
Our use case: We are using Stripe on multiple systems. One of those is Craft Commerce. However, on Craft, we only want to allow the use of cards for payment on our Stripe form. The other system(s) use additional payment type(s) that we aren't going to use on our website just yet. So, we want to only display the Card as a payment option. Stripe has the some support for custom payment method configurations. However, I'm not seeing how to utilize this with this plugin. If there is already a way to accomplish what we're trying to do, I'd love to hear it! Otherwise, we'll keep trying to figure out how to make it work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found this is possible through https://github.com/craftcms/commerce-stripe?tab=readme-ov-file#buildgatewayrequest -- essentially doing something like: Event::on(
PaymentIntents::class,
PaymentIntents::EVENT_BUILD_GATEWAY_REQUEST,
function (BuildGatewayRequestEvent $e) {
/** @var Transaction $transaction */
$transaction = $e->transaction;
$order = $transaction->getOrder();
$e->request['amount'] = $order->outstandingBalance;
$e->request['currency'] = $order->paymentCurrency;
$e->request['automatic_payment_methods'] = ['enabled' => true];
$e->request['payment_method_configuration'] = $stripeConfigId;
},
); |
Beta Was this translation helpful? Give feedback.
I found this is possible through https://github.com/craftcms/commerce-stripe?tab=readme-ov-file#buildgatewayrequest -- essentially doing something like: