After years of hard work with Stripe connector for PrestaShop, 202 ecommerce stop the development of Stripe module on January 9th 2023. Thanks for all contributors that help us!
Disable stripe in shop 1 and install another payment solution (it should not matter which)
Enable and configure stripe in shop 2
Provoke the error
In BO choose shop 1
Search an order
Display the details of the order => Error 500
Stacktrace
/vendor/stripe/stripe-php/lib/BaseStripeClient.php in __construct at line 55
/modules/stripe_official/classes/StripeDispute.php in getAllDisputes at line 43
/modules/stripe_official/classes/StripeDispute.php in orderHasDispute at line 51
/modules/stripe_official/stripe_official.php in hookDisplayAdminOrderContentOrder at line 1286
public function hookDisplayAdminOrderContentOrder($params)
{
$stripePayment = new StripePayment();
$stripePayment->getStripePaymentByCart($params['order']->id_cart);
$stripeCapture = new StripeCapture();
$stripeCapture->getByIdPaymentIntent($stripePayment->getIdPaymentIntent());
$stripeDispute = new StripeDispute();
$dispute = $stripeDispute->orderHasDispute($stripePayment->getIdStripe()); <<<<
The reason is stripe is disabled in this shop, thus it is impossible to instantiate the BaseStripeClient.
Solution
hookDisplayAdminOrderContentOrder must not search for disputes, if the module stripe is not activated in the current shop, or if there is no payment:
Setup to reproduce:
Provoke the error
Stacktrace
/vendor/stripe/stripe-php/lib/BaseStripeClient.php in __construct at line 55 /modules/stripe_official/classes/StripeDispute.php in getAllDisputes at line 43 /modules/stripe_official/classes/StripeDispute.php in orderHasDispute at line 51 /modules/stripe_official/stripe_official.php in hookDisplayAdminOrderContentOrder at line 1286
The reason is stripe is disabled in this shop, thus it is impossible to instantiate the
BaseStripeClient
.Solution
hookDisplayAdminOrderContentOrder
must not search for disputes, if the module stripe is not activated in the current shop, or if there is no payment: