When you directly call the direct card charge endpoints, you’ll need to encrypt your payload containing the card details before making the request.
You do not need to worry about encryption if you use one of our backend sdks. You can simply pass your encryption key to the library, and it will automatically encrypt the payload before sending the request.
To encrypt your payload manually, you will need an encryption key from the Settings > API section of your dashboard. This uses the 3DES algorithm to encrypt the payload.Below is an example of an encryption function in different languages. In each case, the function takes the payload as a hash, converts it to JSON, encrypts and encodes it in base64: