Make payment
Confirm the initiated payment request. You can choose to make the payment by Mobile Money or by credit card. Credit card payments are not available in sandbox.
End point: {BASE_URL}/api/gateway/makepayment
Make payment with Mobile Money
Request method: POST
curl --location --request POST '{{base_url}}/api/gateway/makepayment' \
--header 'x-api-key: live_F1izxxxxxxxx' \
--header 'mode: live' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic cGF5dW5pdF9xxxxxxxxxxh' \
--data-raw '{
"gateway": "CM_ORANGE",
"amount": 10000,
"transaction_id": "pu-xxxxx-xxxxxxxx",
"return_url": "https://my.website.com/payunit/return",
"phone_number": "67xxxxxxx",
"currency": "XAF",
"paymentType": "button",
"notify_url":"https://webhook.site/d457b2f3-dd71-4f04-9af5-e2fcf3be8f34"
}'
Request Body :
Parameter | Mandatory | Description |
---|---|---|
gateway | Yes | The payment method you wish to use |
transaction_id | Yes | The unique identifier that identifies the transaction in your system, example SDK-4587295 |
phone_number | Yes | Your customer's phone number must be compatible with the payment method used |
return_url | Yes | The url or the endpoint or the customer will be redirected at the end of the payment. if you use hostedpage |
notify_url | No | Notification webhook of the payment result to your server by payunit |
currency | Yes | The currency you want to use: XAF |
amount | Yes | Confirmation of the initiated amount desired to be collected |
paymentType | Yes | paymentType Value button |
Response body :
{
"status": "SUCCESS",
"statusCode": 200,
"message": "xxxxxxxxxxxxxxxxxxxxxxxx ",
"data": {
"id": "pu-111-2020",
"transaction_id": "xxxxxxx",
"payment_status": "PENDING",
"amount": 10,
"provider_transaction_id": "xxxxxxxxxxxxxxxxxxxxxxx"
}
}
Make payment with Card
Note here that we only accept 3D secured cards.
Request method: POST
curl --location --request POST '{{base_url}}/api/gateway/makepayment' \
--header 'x-api-key: live_F1izxxxxxxxx' \
--header 'mode: live' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic XXXXXXXXXXXXcGF5d9xxxxxxxxxxh' \
--data '{
"gateway": "WORLD_VISA",
"amount": 2000,
"transaction_id": "jLDD8xxxxx",
"return_url": "https://xxxxxxxxxxxx.xxx",
"currency": "XAF",
"notify_url":"https://xxxxxxxxxxxx.xxx",
"card_number":"4556052xxxxxxx",
"cvv":"899",
"expiry_month":"09",
"expiry_year":"32",
"card_country": "CM",
"card_state": "Littoral",
"card_city": "Douala",
"card_address": "BonamouXXXXXX",
"card_zipcode": "4785"
}'
Request Body :
Parameter | Mandatory | Description |
---|---|---|
gateway | Yes | The payment method you wish to use |
transaction_id | Yes | The unique identifier that identifies the transaction in your system, example SDK-4587295 |
amount | Yes | Confirmation of the initiated amount desired to be collected |
return_url | Yes | The url or the endpoint or the customer will be redirected at the end of the payment. if you use hostedpage |
notify_url | No | Notification webhook of the payment result to your server by payunit |
currency | Yes | The currency you want to use: XAF or XOF, USD |
card_number | Yes | The number of the card with which you wish to make the payment |
cvv | Yes | The cvv of the card with which you wish to make the payment |
expiry_month | Yes | The month of expiration of the card with which you wish to make the payment. Ex : 02 |
expiry_year | Yes | The year of expiration of the card with which you wish to make the payment. Ex : 26 |
card_country | Yes | The country where your card was issued. Ex : CM |
card_state | Yes | The province or region where your card was issued. Ex: If is a region: Alabama, If is a province: Coastal |
card_city | Yes | The city where your card was issued. Ex : Douala |
card_address | Yes | The address when you create your card. |
card_zipcode | Yes | Le code postal lors de la création de votre carte. |
Response body :
{
"status": "SUCCESS",
"statusCode": 200,
"message": "xxxxxxxxxxxxxxxxxxxxxxxx ",
"data": {
"id": "pu-111-2020",
"transaction_id": "xxxxxxx",
"payment_status": "PENDING",
"amount": 1000
}
}
Last updated on April 27, 2023