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.
Parameter | Definition | Sample | Type | isRequired? |
---|---|---|---|---|
first_name | The customer's first name. | Leo | string | Yes |
last_name | The customer's last name. | Levon | string | Yes |
mobile | The customer's mobile number. This should include the ISO 3 country code. | +2348109001000 | string | Yes |
country | The customer's country. This is the ISO 2 country code. | NG | string | Yes |
The customer's email address. | [email protected] | string | Yes | |
amount | The amount to be paid in the transaction. | 200 | int | Yes |
reference | A unique identifier for the transaction. | SAMPLE-REF-01 | string | Yes |
description | A custom descriptor for the transaction, this is very similar to a transaction note or comment. | string | string | Yes |
currency | The specific currency for the transaction attempt. | NGN | string | Yes |
redirect_url | The URL to redirect the user to after completing the payment | https://my-company.com/success | string | No |
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="