I want to add some more parameters in _mapWppFieldset().
But I am not able to override this config class in magento2
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Paypal\Model\Config" type="Vendor\Paypal\Model\Config" />
Vendor\Paypal\Model\Config.php
<?php
namespace Vendor\Paypal\Model;
use Magento\Payment\Helper\Formatter;
class Config extends \Magento\Paypal\Model\Config
{
protected function _mapWppFieldset($fieldName)
{
switch ($fieldName) {
case 'api_authentication':
case 'api_username':
case 'api_password':
case 'api_signature':
case 'sales_api_signature':
case 'sales_api_username':
case 'sales_api_password':
case 'payments_api_signature':
case 'payments_api_username':
case 'payments_api_password':
case 'billing_api_signature':
case 'billing_api_username':
case 'billing_api_password':
case 'account_api_signature':
case 'account_api_username':
case 'account_api_password':
case 'sandbox_api_signature':
case 'sandbox_api_username':
case 'sandbox_api_password':
case 'api_cert':
case 'sandbox_flag':
case 'use_proxy':
case 'proxy_host':
case 'proxy_port':
case 'button_flavor':
case 'button_type':
return "paypal/wpp/{$fieldName}";
default:
return null;
}
}
}