Enable payment tokenization
We can enable payment tokenization by configuring the store's payment form to support tokenization, and then creating extension code to create, update, or remove tokens.
Procedure
- Customize the payment forms of each payment method that the store supports.
- Download and extract the following paymentstokenize.zip file to the workspace_dir/WC/xml/config/ directory. The package includes sample files to set up the payment method configuration, and payment mappings needed for tokenization.
This will set up:
- The sample payment system CustomizationSystem, which maps to the payment plug-in CustomizationPlugin.
- The sample payment method configuration TokenFlow, which maps to the payment system CustomizationSystem.
- Mapping from payment methods VISA and MasterCard to payment method configuration TokenFlow.
Ensure that after extraction, the environment contains the following directory structure.
- workspace_dir/WC/xml/config/payments/edp
- workspace_dir/WC/xml/config/payments/ppc
- Add the payment tokenization payment methods to the database.
Note: Update <StoreIdentifier> in the following statement. This statement updates existing VISA/Master Card policies to support tokenization on the target store.
update policy set properties=concat(properties,'&tokenization=true') where policyname in ('VISA','Master Card') and storeent_id in (select storeent_id from storeent where identifier in (<StoreIdentifier>));
- Implement extension code for the following extension points for payment tokenization.
- create_payment_token
- remove_payment_token
- update_payment_token
- approve_payment
For more information about the extension points, see Payment tokenization extension points.
- Register the extension code createdd for the extension points into the database.
- Create input files using the CmdReg and UEConfig keywords.
See Assigning extension code to extension points. The following input files are provided as samples that we can use and edit as needed.
The samples include:
- The sample extension point configuration for create_payment_token, which maps to POST extension/payment/create_payment_token on the Customization server.
- The sample extension point configuration for update_payment_token, which maps to POST extension/payment/update_payment_token on the Customization server.
- The sample extension point configuration for remove_payment_token, which maps to POST extension/payment/remove_payment_token on the Customization server.
- The sample extension point configuration for approve_payment, which maps to POST extension/payment/approve_payment on the Customization server.
- Save the input files to the WCDE_installdir/samples/DataLoad/xC directory.
- Load the CmdReg and UEConfig files to the database.
- Test the payment method in the store.
- Select VISA or Mastercard as the payment method when you check out. Your extension code for create_payment_token is called when the payment information is submitted.
- Submit the order on the Order confirmation page. Your extension code for approve_payment is called when the order is submitted.
What to do next
To enable in your production environment:
- Repeat the SQL statements against our production database.
- Check in the source code to your source code repository for the CI/CD pipeline to package and deploy the customizations.
- Load your dataload CSV files to your production environment.