The reason is a bit subtle - since it's a virtualType based on CcGenericConfigProvider, the loop in this file:
vendor/magento/module-checkout/Model/CompositeConfigProvider.php
foreach ($this->configProviders as $configProvider) {
$config = array_merge_recursive($config, $configProvider->getConfig());
}
will call getConfig() on CcGenericConfigProvider twice. Note that the getConfig function will get called on ./vendor/magento/module-payment/Model/CcGenericConfigProvider.php - not on Bitpay/Core/Model/ConfigProvider.php. This will lead to the recursive merge of the payment configuration, and wrong values for e.g. availableTypes in the authorizenet_directpost will lead to the failed validation:
ccform":{"availableTypes":{"authorizenet_directpost":{"AE":"American Express","VI":"Visa"
this is normal configuration, this is the failing one:
ccform":{"availableTypes":{"authorizenet_directpost":{"AE":["American Express","American Express"],"VI":["Visa","Visa"]...
Since the virtual type is actually not used, suggested PR fixes this issue by removing the injection of a custom config provider and adding bitpay method code to CcGenericConfigProvider the same way it's added in most other payment methods.
This code causes conflict with other payment modules(specifically, the standard Authorize DirectPost):
The reason is a bit subtle - since it's a virtualType based on CcGenericConfigProvider, the loop in this file: vendor/magento/module-checkout/Model/CompositeConfigProvider.php
will call getConfig() on CcGenericConfigProvider twice. Note that the getConfig function will get called on ./vendor/magento/module-payment/Model/CcGenericConfigProvider.php - not on Bitpay/Core/Model/ConfigProvider.php. This will lead to the recursive merge of the payment configuration, and wrong values for e.g. availableTypes in the authorizenet_directpost will lead to the failed validation: ccform":{"availableTypes":{"authorizenet_directpost":{"AE":"American Express","VI":"Visa" this is normal configuration, this is the failing one: ccform":{"availableTypes":{"authorizenet_directpost":{"AE":["American Express","American Express"],"VI":["Visa","Visa"]...
Since the virtual type is actually not used, suggested PR fixes this issue by removing the injection of a custom config provider and adding bitpay method code to CcGenericConfigProvider the same way it's added in most other payment methods.