commerce-stripe
commerce-stripe copied to clipboard
EVENT_BEFORE_CONFIRM_PAYMENT_INTENT no longer functional
Description
Previously, the server would confirm the PaymentIntent, allowing additional request parameters to be added through the EVENT_BEFORE_CONFIRM_PAYMENT_INTENT event. Our code injected the MOTO flag for mail order payments using this hook. This is no longer functional. Instead, the PaymentIntents are being confirmed client side, preventing the server from injecting any additional parameters.
Steps to reproduce
- Install plugin
- Create hook as below to inject moto parameter for mail order payments
- Hook is never run
Event::on(PaymentIntents::class, PaymentIntents::EVENT_BEFORE_CONFIRM_PAYMENT_INTENT, static function (PaymentIntentConfirmationEvent $event) {
if (Craft::$app->user->getIdentity()) {
$event->parameters['payment_method_options'] = [
'card' => [
'moto' => true
]
];
}
});
Additional info
- Craft CMS version: 4.7.3
- Stripe for Craft Commerce version: 4.1.1
- PHP version: 8.2
Hi @phillmorgan28
A quick question on this, is it for both people entering their card details correctly and for those choosing to pay with an existing payment method? Or just one or the other?
Thanks!
Hi, this is for customers who enter their card details each time. We are not using saved payment methods in our implementation.
Just for clarification, our client uses the front end of their site to enter customer card details from their customers over the phone. We then hook the above event to inject to MOTO flag. Whether the transaction is completed on the front end or admin area doesn't matter, payment intents are never confirmed from the server side anymore, making it impossible to use the moto flag per Stripes docs.
Thanks!