Skip to content

Error for Payment Title - config string translated cause 500 error on success page #71

@antoniocarboni

Description

@antoniocarboni

Hi
The module cause this error on checkout success:

TypeError: Hyva\Theme\ViewModel\Sales\PaymentInfo::getPaymentTitle(): Return value must be of type string, Magento\Framework\Phrase returned in vendor/hyva-themes/magento2-theme-module/src/ViewModel/Sales/PaymentInfo.php:41

This issue is caused by a strange method located here:
www/vendor/qenta/magento2-qcp/Model/AbstractPayment.php

    public function getTitle()
    {
        return $this->_dataHelper->__($this->getConfigData('title'));
    }

I don't understand why a string from the config is translated.
Furthermore, a helper was used to extend too many core methods, including the translation method, for no valid reason.
This goes against development best practices.
A refactor should be done to eliminate the helper and integrate only the truly necessary code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions