This is an example module demonstrating how to add a custom cardholder name field to the Braintree transaction request within Magento 2.
- No need to register cardholder name field within the Braintree Control Panel, neither Braintree Sandbox Account Panel
- Braintree developer documentation
- Custom validation can be implemented
- Override Braintree form and add a new field [Exaple]
- Render a new hosted field in overridden method renderer [Exaple]
- Add a preference for class that implements PayPal\Braintree\Gateway\Response\VaultDetailsHandler [Example]
- Extend VaultDetailsHandler class and add new get payment token [Exaple]
- At the end you can render new data in e.g. Magento\Vault\Block\CardRendererInterface template like
$block->getCardHolderName()