You can try with below method for payment encryption method to get value
,
You have to replace \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
with below class path, \Magento\Payment\Gateway\ConfigInterface
This is works fine,
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Vendor\Package\Block;Vendor\Module\Gateway\Http;
use Magento\Payment\Gateway\Http\TransferBuilder;
use Magento\Payment\Gateway\Http\TransferFactoryInterface;
use Magento\Payment\Gateway\Http\TransferInterface;
use Magento\Payment\Gateway\ConfigInterface;
class TestTransferFactory implements TransferFactoryInterface
{
protectedprivate $config;
private $transferBuilder;
public function __construct(
..ConfigInterface $config,
\Magento\Payment\Gateway\ConfigInterfaceTransferBuilder $config$transferBuilder
) {
..
) {$this->config = $config;
$this->config>transferBuilder = $config;$transferBuilder;
}
public function getPaymentKey()
{
$key=echo $this->config->getValue('payment/webpay/keyid');
echo $key;
}
}