Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVENT_BEFORE_CONFIRM_PAYMENT_INTENT no longer functional #297

Open
phillmorgan28 opened this issue Apr 3, 2024 · 3 comments
Open

EVENT_BEFORE_CONFIRM_PAYMENT_INTENT no longer functional #297

phillmorgan28 opened this issue Apr 3, 2024 · 3 comments

Comments

@phillmorgan28
Copy link

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

  1. Install plugin
  2. Create hook as below to inject moto parameter for mail order payments
  3. 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
Copy link

linear bot commented Apr 3, 2024

@nfourtythree
Copy link
Contributor

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!

@phillmorgan28
Copy link
Author

phillmorgan28 commented Apr 16, 2024

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!

@lukeholder lukeholder self-assigned this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants