I've installed the Magento2 Stripe extension following this guide: https://stripe.com/docs/plugins/magento/install#manual
The extension is active and I've setup Stripe to send test data. The problem is when I go to the checkout and place the order the following call to http://app.test/rest/default/V1/guest-carts/oza7bFkKh19JjTYedtbp9AyuneWJjtc9/payment-information returns an error:
<br />
<b>Fatal error</b>: Uncaught Error: Class 'Stripe\PaymentIntent' not found in C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentIntent.php:149
Stack trace:
#0 C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentIntent.php(612): StripeIntegration\Payments\Model\PaymentIntent->create(Object(Magento\Quote\Model\Quote\Interceptor), Object(Magento\Sales\Model\Order\Payment\Interceptor))
#1 C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentMethod.php(232): StripeIntegration\Payments\Model\PaymentIntent->confirmAndAssociateWithOrder(Object(Magento\Sales\Model\Order\Interceptor), Object(Magento\Sales\Model\Order\Payment\Interceptor))
#2 C:\laragon\www\generated\code\StripeIntegration\Payments\Model\PaymentMethod\Interceptor.php(50): StripeIntegration\Payments\Model\PaymentMethod->capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), '59.98')
#3 C:\laragon\www\vendor\magento\module-sales\Model\Order\Payment\Operations\CaptureOperation.php(82): StripeIntegration\Payments\Model\PaymentMethod in <b>C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentIntent.php</b> on line <b>149</b><br />
{"messages":{"error":[{"code":500,"message":"Fatal Error: 'Uncaught Error: Class 'Stripe\\PaymentIntent' not found in C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentIntent.php:149\nStack trace:\n#0 C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentIntent.php(612): StripeIntegration\\Payments\\Model\\PaymentIntent->create(Object(Magento\\Quote\\Model\\Quote\\Interceptor), Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor))\n#1 C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentMethod.php(232): StripeIntegration\\Payments\\Model\\PaymentIntent->confirmAndAssociateWithOrder(Object(Magento\\Sales\\Model\\Order\\Interceptor), Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor))\n#2 C:\\laragon\\www\\generated\\code\\StripeIntegration\\Payments\\Model\\PaymentMethod\\Interceptor.php(50): StripeIntegration\\Payments\\Model\\PaymentMethod->capture(Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor), '59.98')\n#3 C:\\laragon\\www\\vendor\\magento\\module-sales\\Model\\Order\\Payment\\Operations\\CaptureOperation.php(82): StripeIntegration\\Payments\\Model\\PaymentMethod' in 'C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentIntent.php' on line 149","trace":"Trace is not available."}]}}
I can see in the Stripe webhook logs that the payment is being received also.
Have I missed something during the install step that's causing this to happen?
-
Hi, Did you find a solution to this issue? I have the same. I'm assuming it's an installation issue.Jagoman– Jagoman2020年05月01日 13:47:45 +00:00Commented May 1, 2020 at 13:47
1 Answer 1
The error means that the Stripe PHP library dependency was either not installed, or is out of date. You can try the following:
composer remove stripe/stripe-php
composer require stripe/stripe-php
This will install the latest version of the Stripe PHP library (but check which one is required by your installed module to be safe)
Explore related questions
See similar questions with these tags.