Encrypt your customer's details and transaction information

When creating an order, you should encrypt the details of your customers and transaction information like reference and description of the payment.

📘

All encryption should be done using the RSA Algorithm. We cover the basics in our encryption guide, but you can reach out to support if you encounter any encryption errors.

The following details are required to create an order.

ParameterDefinitionSampleTypeisRequired?
first_nameThe customer's first name.LeostringYes
last_nameThe customer's last name.LevonstringYes
mobileThe customer's mobile number. This should include the ISO 3 country code.+2348109001000stringYes
countryThe customer's country. This is the ISO 2 country code.NGstringYes
emailThe customer's email address.[email protected]stringYes
amountThe amount to be paid in the transaction.200intYes
referenceA unique identifier for the transaction.SAMPLE-REF-01stringYes
descriptionA custom descriptor for the transaction, this is very similar to a transaction note or comment.stringstringYes
currencyThe specific currency for the transaction attempt.NGNstringYes
redirect_urlThe URL to redirect the user to after completing the paymenthttps://my-company.com/successstringNo

After you collect this information from the customer structure it as a json object before encrypting. The expected JSON structure includes nested objects containing customer and order details. Here is a sample request to be encrypted:

//Unencrypted request
{
   "customer":{
      "first_name":"Example",
      "last_name":"User",
      "mobile":"+2348101234544",
      "country":"NG",
      "email":"[email protected]"
   },
   "order":{
      "amount":100,
      "reference":"Example-Reference-0020",
      "description":"Test Payment",
      "currency":"NGN"
   },
   "payment":{
      "redirect_url":"https://my-company.com/success"
   }
}

// Encrypted payload
"data": "RYa9nWa+TnZ2O8b7HC8ru3TuIZ/FpzCKuSur7MyAH3rVIyaAqOIhY5/vBlVSNHh3WN2B2XMTiEGj4QuViqlx7TgzWiEyIq6WGKT9Jzd0XPoVrSEmLVuh4EZMPDJPXEiPnZsoEpQdFxxUlf03/OK1KcjG414Yq2s5hSA869pVZY4cz/XJ6DmttO+WX5daWoH0jlb879EN+ig4tQY3nvi2rjaF6dre2L+o3/Duh632cqX3SSCawFgNGwU/OkAim+8tFnLwC3LMpN3CjV0tMJBA4p2UyWtnNvlCNoHo55toVHjO+OIes2HwPKWOcfJjuupjuiI2zGIpFF2ywboYT+nChrxJ00sPJVizLKRsvYZ+Tqmd1QShsaNTsgBgxABUUow3CXumsLs5g+4VnhxB8lNpl8bRACb7zdu1H9fFeqWnzLhzQu5rb3c1ko/lpOXpRJl7oyYpFThTBMvtucG5ADhPyUZunnf8NevgXbfdLwi8O8BQBpgrxiqKJeDzflpIiGa4rwf3qEl4J1i7f+IzFXiVi98JRFSaaUGTS78s+Z3FOjhk1ybZ2DtgVJ4sclAr1GqbycZTPFJn9ymICbc1XCeQEFc0Mt8Z/lhm3j4cUT8Ihsi8X14fgC+Bd45HdBdWR94KPZOP1WM6QMze4bygra1qfpygff1F+5aAb1KjQ5+0rOE="