To start the full integration, we must first configure your public and private keys, to do this you must click on the Generate a key pair button.
This action will open a modal where you must choose how you want to generate your keys.
Help me create a pair of keys for me
By selecting this option, you only have to save the keys that we generate for you.
When clicking on the Continue button, you must make sure that you have saved at least your private key, since it will be of vital importance that you store it in a safe place on your server.
I would like to generate and upload my own keys
When selecting this option, you must generate your own public and private keys, for this you can follow our guide here. We recommend that you do not generate these keys on any website, as your private key could be compromised.
Once you have generated your keys, just share with us only your public key.
Integration with your server
For security reasons and integrity of the information, you must sign with your RSA SHA256 private key the detail of the purchase to be paid, which must be an instance of PurchaseData as a JSON object, we recommend generating your instance from your server for security and integrity reasons; Here is an example:
Important:Make sure that the sum of the fields of purchaseSummary corresponds to grandTotalAmount , since Otherwise, the payment cannot be made. If any of the purchaseSummary fields do not apply to your payment order, you can assign a 0 value.
Once you have your instance of PurchaseData , we proceed to transform it into a text string; As an example, in Javascript you can use the JSON.stringify(purchaseData) method, but it will depend on the technology you use on your server, here is an example of your instance transformed to a string:
We continue signing your text string with your RSA SHA256 private key , since, for security and information integrity reasons, you must sign with your RSA SHA256 private key in format base64 , you can follow the instructions we have here . We will name this signature purchaseSignature.
Having your text string of your PurchaseData and your purchaseSignature , we can continue with the integration by selecting one of the following options:
Note:The properties of each entity that are suffixed with a ? are optional, while those with a ! are required; In the case of parameters, the same rule of the suffix applies? as optional.