From 446ffdb1953da92f47489bb9b1ba126131c3ba1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20N=C3=B8rgaard?= Date: Thu, 16 Jul 2026 01:45:43 +0200 Subject: [PATCH] Remove fragile bundled-vendor autoload require OffsiteRedirect.php began with: require_once __DIR__ . '/../../../../vendor/autoload.php'; which resolves to payfast/vendor/autoload.php - a path that only exists when the module is checked out and 'composer install' is run inside it. Installed the normal way (composer require payfast/commerce_payfast), the module ships no vendor/ of its own, so this require_once fatals with 'Failed opening required'. It is also redundant: payfast/payfast-common is a declared dependency in the module's composer.json, so Payfast\PayfastCommon\...\PaymentRequest is resolved by the project autoloader through the existing 'use' statement. Removing the line fixes standard installs and changes nothing for the bundled-vendor dev layout. --- payfast/src/Plugin/Commerce/PaymentGateway/OffsiteRedirect.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/payfast/src/Plugin/Commerce/PaymentGateway/OffsiteRedirect.php b/payfast/src/Plugin/Commerce/PaymentGateway/OffsiteRedirect.php index d485bf3..58f0eaf 100644 --- a/payfast/src/Plugin/Commerce/PaymentGateway/OffsiteRedirect.php +++ b/payfast/src/Plugin/Commerce/PaymentGateway/OffsiteRedirect.php @@ -2,8 +2,6 @@ namespace Drupal\commerce_payfast\Plugin\Commerce\PaymentGateway; -require_once __DIR__ . '/../../../../vendor/autoload.php'; - use Drupal; use Drupal\commerce_order\Entity\Order; use Drupal\commerce_order\Entity\OrderInterface;