Token UI component provider
This topic describes how to create custom vault payments UI components, that are used to display stored tokens on checkout page and order placing using vault.
Token component provider
The main logic for displaying tokens on checkout page is located in
Vault TokensConfigProvider. You just need to create a token component provider. It should implement the
The basic implementation of the token UI component provider can be like following:
This implementation allows to retrieve all available payment token details and specify the JS component for storefront.
Having created the component provider, you need to add it to the list of available vault config providers in
di.xml - the DI configuration file.
In the following example the
Magento\Braintree\Model\Ui\TokenUiComponentProvider component provider is added to this list:
In you custom module directory, create the component’s
.js file. It must be located under the
The component should extend vault.js:
Display stored tokens for customer and process their deleting.