Closed robertspinja closed 11 months ago
Thank you for taking the time to submit this issue and thorough description. Your contributions to our project are greatly appreciated.
We've reviewed your issue, and after testing your proposed fix, released a new version of the Svea payment module.
Thanks again for your contribution.
If payment is cancelled after checkout, if a project uses Magento_QuoteGraphQl, it will cause errors for the module.
https://github.com/maksuturva/magento2_payment_module/blob/master/app/code/Svea/Maksuturva/Model/HandlingFeeApplier.php#L28
The issue is that
$paymentMethod = ' '
is a space, so the cancel controller will set the method as a space character. Which then causesgetMethodInstance()
to not throw an error, but return "Substitution" method instance, which returns title as null. Which then causes the error. https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/QuoteGraphQl/Model/Resolver/SelectedPaymentMethod.php#L38 Space character method cancelled payments in quote_payment table:Changing
$paymentMethod = ' '
to$paymentMethod = ''
fixes these errors, and sets the payment method in database as null. There doesn't seem to be a clear reason in the commit why a space character was chosen to unset the payment method: https://github.com/maksuturva/magento2_payment_module/commit/429df6371e1be32a72ab0fad29dad687ed7f1e48#diff-5b4b9c42871a5fd7bb5aa14e162e4ed0b1607ab339d4aee857ec9ac84ab14675