Custom Form allows you to create your own payment forms and consume API objects in a unitary way in order to create a unique payment experience fully integrated into your services.
Therefore, a Custom Form is created and hosted by you while allowing you to strongly reduce the security risks when handling banking data. By integrating the payment process on your side, you keep control of the payment page and user experience.
Custom Form allows consumption of certain services not supported by Smart Form like subscription payments (subscription) or one-click upsell payment.
Example of Custom Form
Custom Form tutorial
Once you get a cardTokenID, you are now able to create a transaction in order to debit your customer card.
Required steps :
1Creating an HTML payment form
Contrary to the SMART form which is generated by the platform, the CUSTOM form is to be created.
So you need to generate the HTML code at your convenience.
2Sending the debit/ credit card information with the Token.js
At this stage, you have now to send the card data from the client browser to the PCI platform. The platform will send you back a cardTokenId. To get it done you need to add the following script tag in the <body> part at the end of your code.
Then your merchantPublicKey in a separe tag.
The merchantPublicKey identifies your requests to the platform. In the example above, you will have to use the one that has been sent to you.
3Getting back the cardTokenID in your system
All card data are now stored in the cardTokenId for a duration of 5 minutes. This value is sent to the API instead of the sensitive credit card data.
4Submitting the form from your server
Now that you have a cardTokenID you can use it to trigger a transaction.
Unlike the previous steps that take place from the browser, this operation is executed from your servers. For example :
curl -v https://test-api.centralpay.net/v2/rest/transaction \ -u 'DEMOPSC:eUZG&DVD6cCD' \ -d amount= 100 -d currency= EUR -d cardTokenId=d5bc9bec-aec2-4b92-b45c-23d53719a058 \ -d endUserIp=126.96.36.199 \
5Saving the card information in a customer object in order to use it afterwards (1 click, subscription…)
CentralPay's cardTokenId can only be used once, but if you plan to use it afterwards, you need to create a customer object in which you can store all cards details.
Instead of charging the card immediately, you have to create a customer object. CentralPay then stores a cardtoken within this customer object during the process. This precise action will allow you to charge the customer at any time in the future.