0

I use the following components:

magento (community) ver. 2.3.5-p1
iways/module-pay-pal-plus ver. 1.3.1 (github.com, marketplace.magento.com)

Since the last update to 2.3.5-p1, the behaviour for payments via the PayPal PLUS Extension has changed. Until now, payments via the PayPal PLUS extension were booked with the PayPal transaction type "Capture". Since the update, the PayPal Transaction Type "Authorization" is used for booking.

To clarify my problem, here are two pictures from the Magento admin interface: Transaction Type "Authorization"
New behavior since the update to magento 2.3.5-p1

PayPal transaction type "Capture"
Usual behaviour from magento 2.3.4

The change ensures that incoming orders are not automatically processed by our system. The creation of an invoice and the update of the stock is no longer done automatically but has to be triggered manually for each incoming order. We still use the "PayPal Express Checkout" in parallel to the PayPal PLUS extension, which continues to work perfectly.

I cannot find a setting to change the one I use. How do I change the PayPal transaction type of the extension, so that the order process in our magento backend is automated again?

Or is there a more common way to capture authorized PayPal payments and automatically generate invoices for those orders than changing the PayPal transaction type?

Desired behavior:
after a customer has successfully paid his order via PayPal PLUS, the order should be marked as paid in the Magento admin interface and an invoice should be created automatically.

3
  • Hi, did you solve this? Having the same issue with this extension. – simonthesorcerer Nov 21 '20 at 18:20
  • @simonthesorcerer No, not yet. The manufacturer could not help me either and only highlighted that they are working on an update of the extension, but do not know if this fixes the bug. – max stern Dec 10 '20 at 19:05
  • 1
    Yes, the Iways support is terrible. I don't remember what shop I was working on when I commented, but maybe here's a fix that may help you: go to vendor/iways/module-pay-pal-plus/Controller/Webhooks/Index.php and remove the dependency for the DriverInterface in the constructor. This throws an error and blocks Paypal's webhook response.Then go to line 132 of the same file and replace it with $data = file_get_contents('php://input');, so the driver is actually never used. Discussion why Iways' solution is wrong here: github.com/magento/magento2/issues/24667 – simonthesorcerer Dec 10 '20 at 19:11
0

After months without any support or answers from the extension authors i-ways.net, I found a very helpful PR in the GitHub repository of the extension. 🎉

Addition to the original posting

In summary, the error described in the opening post actually has nothing to do with faulty PayPals transaction types. Only the error during the webhook execution was responsible for the fact that the PayPal transaction was not fully captured and thus remained in the status authorization.
The error in the webhook execution meant that no automatic exchange of the status of the payment process between PayPal and Magento could take place. This means that every order paid via PayPal Plus had to be processed manually in the Magento admin interface and no automatic invoicing was possible.

The error pattern

Obviously the authors of the extension made a careless mistake which leads to an error during the webhook execution which finally prevents the correct execution. In the logfiles the error was reported like this:

[Wed Feb 17 14:13:32.835783 2021] [proxy_fcgi:error] [pid 23446:tid 139947608532736] [client 173.0.81.33:42850] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\\Framework\\Filesystem\\DriverInterface in /var/www/share/<domain>/magento_live/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:116\nStack trace:\n#0 /var/www/share/<domain>/magento_live/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->createObject('Magento\\\\Framewo...', Array)\n#1 /var/www/share/<domain>/magento_live/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Magento\\\\Framewo...')\n#2 /var/www/share/<domain>/magento_live/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\\Framework\\ObjectManager\\Factory\\Compiled->get('Magento\\\\Framewo...')\n#3 /var/www/share/<domain>/magento_live/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\\Framework\\ObjectManager\\Factory\\Compiled->create('Iways\\\\P...'

Troubleshooting

Changing a single line of code in vendor/iways/module-pay-pal-plus/Controller/Webhooks/Index.php fixed the problem.

[...]
95           \Iways\PayPalPlus\Model\Webhook\EventFactory $webhookEventFactory,
96           \Iways\PayPalPlus\Model\ApiFactory $apiFactory,
97           \Psr\Log\LoggerInterface $logger,
98  -        \Magento\Framework\Filesystem\DriverInterface $driver
98  +        \Magento\Framework\Filesystem\Driver\File $driver
99       ) {
100          $this->_logger = $logger;
101          $this->_webhookEventFactory = $webhookEventFactory;
[...]

Due to the bad support we will not use the extension from i-ways.net in the future and are currently looking for alternatives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.