Add-ons and ModulesCustom Payment Module: Docdata

Custom Payment Module: Docdata

Sana Commerce 8.2
Your provider


We will take the Docdata payment module as an example on how to create a custom payment module. Docdata is a payment service provider that follows the flow of most other payment service providers. After reading the documentation about Docdata implementations you will notice that some things have to be changed from as they are now in the default external payment method implementation. This includes:
  • Before we can redirect the user to the Docdata payment site we need to create a cluster by making a call to an URL sending order data. This will return a cluster which we will need to supply when redirecting the user;
  • We need to supply some user data like email, address to this create cluster call;
  • Instead of passing the status to the confirm page Docdata requires us to make another call to them to get the status. The benefit of this is increased security.
Furthermore the following things always have to be changed or verified when creating a custom PSP implementation:
  • We need to map the PSP status and Payment method to the right Sana Commerce field;
  • We need to pass the correct order Id to the confirm pipeline;
  • We need to add configuration values needed in Docdata;
  • We need to configure the default configuration values to work with Docdata.
Add-ons and ModulesCustom Payment Module: Docdata