@woutse There is an issue with the ShipmentSaveAfter observer when auto capturing is enabled for Klarna payments.
The pay order id which is saved as last_trans_id in the sales_order_payments table, contains a '-capture' suffix. So when the ShipmentSaveAfter is called, the Pay API throws an exception:
[2023-09-19T10:45:14.294357+00:00] main.CRITICAL: Paynl\Error\Api: - Transaction not found in /home/releases/a9becff9/vendor/paynl/sdk/src/Api/Api.php:155
Stack trace:
#0 /home/releases/a9becff9/vendor/paynl/sdk/src/Api/Api.php(80): Paynl\Api\Api->processResult()
#1 /home/releases/a9becff9/vendor/paynl/sdk/src/Api/Transaction/Info.php(51): Paynl\Api\Api->doRequest()
#2 /home/releases/a9becff9/vendor/paynl/sdk/src/Transaction.php(290): Paynl\Api\Transaction\Info->doRequest()
#3 /home/releases/a9becff9/vendor/paynl/magento2-plugin/Observer/ShipmentSaveAfter.php(110): Paynl\Transaction::get()
@woutse There is an issue with the ShipmentSaveAfter observer when auto capturing is enabled for Klarna payments.
The pay order id which is saved as last_trans_id in the sales_order_payments table, contains a '-capture' suffix. So when the ShipmentSaveAfter is called, the Pay API throws an exception:
I solved this by adding the same solution as in https://github.com/paynl/magento2-plugin/blob/master/Model/Paymentmethod/PaymentMethod.php#L428