cancel
Showing results for 
Search instead for 
Did you mean: 

How to display custom value in Payment Information block sales order view admin magento 2

How to display custom value in Payment Information block sales order view admin magento 2

I am creating redirect payment in magento 2. I need to display my custom values in admin salse order payment info block.payment.png

I have tried to rewrite below Magento\Payment\Block\ConfigurableInfo via frontend/di.xml as well as etc/di.xml but its not working.

 

<preference for="Magento\Payment\Block\ConfigurableInfo" type="Demo\Custom\Block\Payment\Info"/>

Here is Info.php code

<?phpnamespace Demo\Custom\Block\Payment;

use Magento\Framework\Phrase;
use Magento\Payment\Block\ConfigurableInfo;

class Info extends ConfigurableInfo
{
    protected function getLabel($field)
    {
        switch ($field) {
            case 'paymentid':
                return __('Payment Id');
            case 'result':
                return __('Transaction Status');
            case 'tranid':
                return __('Transaction ID');
            case 'auth':
                return __('Authorization Number');
            case 'trackid':
                return __('Tracking Id');
            default:
                return parent::getLabel($field);
        }
    }
}

Thanks for your answer in advance.

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.