Read all the sections in blue to better understand the documentation and the sections in orange signifying the alert in order to avoid mistakes to be made during the integrations and the detailed procedures for the integrations.
API keys are your digital references towards PayDunya systems. We use them to identify your account and the applications you will create. These keys are necessary for any integration of the APIs of PayDunya's payments APIs. Here are the steps to follow:
Test mode, I want to make payment tests
and
Enable production mode
.
https://app.paydunya.com/api/v1/checkout-invoice/create
curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: live_private_rMIdJM3PLLhLjyArx9tF3VURAF5" \
-H "PAYDUNYA-TOKEN: IivOiOxGJuWhc5znlIiK" \
-X POST -d '{"invoice": {"total_amount": 5000, "description": "Chaussure VANS dernier modèle"},"store": {"name": "Magasin le Choco"}}' \
"https://app.paydunya.com/api/v1/checkout-invoice/create"
{
"response_code":"00",
"response_text":"https://app.paydunya.com/checkout/invoice/ERtyuILouhhRHICF0HboN",
"description":"Checkout Invoice Created",
"token":"ERtyuILouhhRHICF0HboN"
}
Here is presented below, the complete structure of the PayDunya invoicing JSON object. Most items are optional, but get in the habit of providing them all as it will give you much more flexibility. The required JSON nodes for submitting a bill payment HTTP POST request to our API Endpoints are: the root node invoice
and its child node total_amount
as well as the root node store
and its child node name
.
{
"invoice": {
"items": {},
"taxes": {},
"total_amount": 5000,
"description": "",
"store": {
"name": "Magasin le Choco",
"tagline": "",
"postal_address": "",
"phone": "",
"logo_url": "",
"website_url": ""
},
"custom_data": {},
"actions": {
"cancel_url": "",
"return_url": "",
"callback_url": ""
}
}
}
Refer to the full JSON structure to you know exactly where to insert the following structure. The "items"
are used to display to the customer on the payment page the list of items he has ordered. Under no circumstances will PayDunya use any of the amounts declared in "items"
to bill the customer.
{
"items": {
"item_0": {
"name": "Chaussures Croco",
"quantity": 3,
"unit_price": "10000",
"total_price": "30000",
"description": "Chaussures faites en peau de crocrodile authentique qui chasse la pauvreté"
},
"item_1": {
"name": "Chemise Glacée",
"quantity": 1,
"unit_price": "5000",
"total_price": "5000",
"description": ""
}
}
If you want to display on the PayDunya invoice the taxes you apply (TVA, delivery costs...) you can do so using the JSON node taxes
as shown below.
"taxes": {
"tax_0": {
"name": "TVA (18%)",
"amount": 6300
},
"tax_1": {
"name": "Livraison",
"amount": 1000
}
}
If you need to add additional data (for example for a contest, you can save information about each winner) for later use, we offer you the possibility to save this data on our servers and to be able to get them back after successful payment.
{info.fa-lightbulb-o}
"custom_data": {
"categorie": "Jeu concours",
"periode": "Noël 2015",
"numero_gagnant": 5,
"prix" : "Bon de réduction de 50%"
}
"custom_data": {
"phone_brand": "Nokia",
"IMEI": "72892821010728",
"model": "Luna"
}
It may be that for reasons x or y, that the payment confirmation is not instantaneous (for example the time that the customer types his secret code on his telephone or the latency time of the telephone network), the IPN allows you Instantly receive transaction information for payment confirmed
, canceled
or failed
.
The IPN corresponds to the URL of a file on your server on which you wish to receive payment transaction information, this information is to be processed in the back office. PayDunya uses this URL to send you instantly, by request POST
, payment transaction information.
"actions": {
"callback_url": "http://www.magasin-le-choco.com/callback_url.php"
}
The successful validation of the payment transaction returns the structure below containing the information on the customer, the URL of his PayDunya invoice in PDF version and also a hash to verify that the data received does indeed come from our servers.
Furthermore, it is essential to understand for information purposes that the payments canceled
or Failed
keep the same response format except the status value changes : for failed payments the status becomes failed
and for payments cancelled
becomes cancelled
.
array (
'data' =>
array (
'response_code' => '00',
'response_text' => 'Transaction Found',
'hash' => '8c6666a27fe5daeb76dae6abc7308a557dca5be1bda85dfe5d81fa330cdc0bc3c4b37765fe5d2cc36aa2ba0f9284226a80f5488d14740fa70769d6079a179406',
'invoice' =>
array (
'token' => 'test_jkEdPY8SuG',
'items' =>
array (
'item_0' =>
array (
'name' => 'Chaussures Croco',
'quantity' => '3',
'unit_price' => '10000',
'total_price' => '30000',
'description' => 'Chaussures faites en peau de crocrodile authentique qui chasse la pauvreté',
),
'item_1' =>
array (
'name' => 'Chemise Glacée',
'quantity' => '1',
'unit_price' => '5000',
'total_price' => '5000',
'description' => '',
),
),
'taxes' =>
array (
'tax_0' =>
array (
'name' => 'TVA (18%)',
'amount' => '6300',
),
'tax_1' =>
array (
'name' => 'Livraison',
'amount' => '1000',
),
),
'token': 'test_Jh2T8skw1j',
'total_amount' => '42300',
'description' => 'Payment de 42300 FCFA pour article(s) achetés sur Magasin le Choco',
),
'custom_data' =>
array (
'categorie' => 'Jeu concours',
'periode' => 'Noël 2015',
'numero_gagnant' => '5',
'prix' => 'Bon de réduction de 50%',
),
'actions' =>
array (
'cancel_url' => 'http://magasin-le-choco.com/cancel_url.aspx',
'callback_url' => 'http://magasin-le-choco.com/callback_url.aspx',
'return_url' => 'http://magasin-le-choco.com/return_url.aspx',
),
'mode' => 'test',
'status' => 'completed',
'customer' =>
array (
'name' => 'Alioune Faye',
'phone' => '774563209',
'email' => '[email protected]',
),
'receipt_url' => 'https://paydunya.com/sandbox-checkout/receipt/pdf/test_jkEdPY8SuG.pdf',
),
)
The hash returned by PayDunya is the hash of your MasterKey (main key). This hash will allow you to ensure that the data you have received comes from our servers. The algorithm used to obtain the hash is SHA-512
. In the expected response, a failure message is entered in the node fail_reason
only for transactions by card failed
ou canc
.
The SOFTPAY API for bank card payments is only available to PCI-DSS certified companies. Activation is done on request.
https://app.paydunya.com/api/v1/softpay/card
{
"full_name": "John Doe",
"email": "[email protected]",
"card_number": "1234567890123456",
"card_cvv": "123",
"card_expired_date_year": "25",
"card_expired_date_month": "11",
"token": "T3JgbeD3xHXoWtmqOktm"
}
{
"success": true,
"message": "Le paiement a été effectué avec succès.",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}
{
"success": true,
"message": "Rediriger vers cette URL pour completer le paiement.",
"url": "https://paydunya.com/card_3ds_redirect?key=eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjYwYmRjNmU0LWRjNjMtNDIxNy05OTU3LTVjZDc0M5zSUQiOiJmZjkxMzc1Mi0zOGRmLTRjZTYtYjM5Zi00MTg4MTE0OTg1ZWQiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDUiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0&url=https://authentication.cardinalcommerce.com/ThreeDSecure/V2_1_0/CReq",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}
{
"success": false,
"message": "Transaction annulée ou Refus de paiement en lien avec votre établissement bancaire.",
"errors": {
"message": "Transaction annulée ou Refus de paiement en lien avec votre établissement bancaire.",
"description": "Transaction annulée ou Refus de paiement en lien avec votre établissement bancaire."
}
}
Discover our brand new Orange Money Senegal API update! Now offer your customers the possibility to pay easily, either by OTP CODE
or by QR CODE
.
For a quick and easy integration, follow the documentation below.
https://app.paydunya.com/api/v1/softpay/new-orange-money-senegal
{
"customer_name": "John Doe",
"customer_email": "[email protected]",
"phone_number": "778676477",
"invoice_token": "GS46gkCAnRv3WfRwFdJU",
"api_type": "QRCODE"
}
{
"success": true,
"message": "Rediriger vers cette URL pour completer le paiement.",
"url": "https://app.paydunya.com/recharge-orange-sn?data%5Bqrcode%5D=iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAAAAACIM%2FFCAAAAAklEQVR4nGKkkSsAAAHxSURBVO3Q23EbQQwEQOaftB3AaaCBZJZX2sbX1RKPab7%2B%2FJJ6%2Fe8A%2F6pATiuQ0wrktAI5rUBOq18KedX1wable%2Fr1ixlAQEAuhqSjz555eers9y96QEBAroekkOm7Pz0DtxlAQEBAtkvml0UYEBAQkDdD5p5mKv0KAgICsoWk6gOkMCne1zKAgICA9Kff973lg4CA3AnZVgow9z975qkuyvemQUDi6u9Ng7wZ8jyUjqbTaUOzuemPZBAQkCshffj%2BXOpsws95QEBAQJoTzdEU%2BBmj%2F%2F5kMwgIyJWQ9XiBbTjz9fQCAgICksbnc%2F3svDNFrTggICBXQraomdbsmQmLAgEBuRgyr03B0lTzMt997v9gAwgIyMWQOXDf03w3L%2FMsCAjIzZAUrKkmRv%2BSCgQEBGQeSYHTS%2FOHzJy%2BEwQEBKQZScAUI22r4oUNICAgINvaBp4JaQoEBARkhqTxPuTzPf069%2Fd8EBCQmyHbmk%2FP%2Fenl2Z9ugYCAgKRgackcO%2FXMe%2Bb98SIICMjFkG2wbbyv7fwkGwgIyPWQtOS5MB2a3%fA%2FSwICAhID9l%2BJ%2BD8PdNAQEBAekgfL%2FXMtcgAAgJyPWRePh%2Faxmj%2BqE9%2BBQEBuRjS1BxpjpribckgICAgP7hATiuQ0wrktAI5rUBOK5DT6i8Qn6uozO88rQAAAABJRU5ErkJggg%3D%3D&data%5Btoken%5D=2da19f97721d74b725cd0bfec625637f52a4fe8180069fdcea8e0658b319a1",
"other_url": {
"om_url": "https://orangemoneysn.page.link/BqPM68VcrMniRxE",
"maxit_url": "https://sugu.orange-sonatel.com/mp/dpBtHptARK6Br_t5k3"
},
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/new-orange-money-senegal
After generating the token, you must ask the end user to generate an Orange Money payment code by following the following USSD code:
#144#391*USER_ORANGE_MONEY_PIN_CODE#
{
"customer_name": "Fallou",
"customer_email": "[email protected]",
"phone_number": "778676477",
"authorization_code": "152347",
"invoice_token": "GS46gkCAnRv3WfRwFdJU",
"api_type": "OTPCODE"
}
{
"success": true,
"message": "Transaction éffectué avec succés"
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/free-money-senegal
{
"customer_name": "Fallou",
"customer_email": "[email protected]",
"phone_number": "768690999",
"payment_token": "GS46gkCAnRv3WfRwFdJU"
}
{
"success": true,
"message": "Opération réussi, Veuillez tapez #150# pour finaliser votre paiement",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
"data": {
"status": "PENDING",
"amount": 200,
"currency": "XOF",
"customermsisdn": 768690999,
"transactionid": "MP210921.1230.B04577",
"externaltransactionid": "FM076_93108370"
},
}
https://app.paydunya.com/api/v1/softpay/expresso-senegal
{
"expresso_sn_fullName": "Fallou",
"expresso_sn_email": "[email protected]",
"expresso_sn_phone": "705189525",
"payment_token": "GS46gkCAnRv3WfRwFdJU"
}
{
"success": true,
"message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter.",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/wave-senegal
{
"wave_senegal_fullName": "Fallou",
"wave_senegal_email": "[email protected]",
"wave_senegal_phone": "777777777",
"wave_senegal_payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}
{
"success": true,
"message": "Rediriger vers cette URL pour completer le paiement.",
"url": "https://pay.wave.com/c/cos-1cj669hbr1350?a=200&c=XOF&m=JOE",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/wizall-money-senegal
{
"customer_name": "John Doe",
"customer_email": "[email protected]",
"phone_number": "777777777",
"invoice_token": "RAV6KK9Ncfy2a6vb3KDT"
}
{
"success": true,
"message": "Requête de paiement effectuée!",
"data": {
"Operation": "MerchantGetMoney",
"TransactionID": "286513913",
"details": {
"message": "MerchantGetMoney Successful",
"service": "merchant-get-money",
"cid": "489eca906856e440e193ab19"
}
},
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/wizall-money-senegal/confirm
{
"authorization_code": "461050",
"phone_number": "777777777",
"transaction_id": "286513913"
}
{
"success": true,
"message": "Paiement réussi",
"return_url": "https://www.paydunya.com/successful-payment",
"token": "oeKyZGwexXkBk4uYyRoJ"
}
After generating the token, you must ask the end user to generate an Orange Money payment code by following the following USSD code:
#144*82# + option 2 to generate an payment code
https://app.paydunya.com/api/v1/softpay/orange-money-ci
{
"orange_money_ci_customer_fullname": "John Doe",
"orange_money_ci_email": "[email protected]",
"orange_money_ci_phone_number": "0777568646",
"orange_money_ci_otp": "8562",
"payment_token": "ljUZxD5T3RRxhpoOl66b"
}
{
"success": true,
"message": "Paiement effectué avec succès."
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/mtn-ci
{
"mtn_ci_customer_fullname": "Fallou",
"mtn_ci_email": "[email protected]",
"mtn_ci_phone_number": "664142312",
"mtn_ci_wallet_provider": "MTNCI",
"payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}
{
"success": true,
"message": "success message",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/moov-ci
{
"moov_ci_customer_fullname": "Camille",
"moov_ci_email": "[email protected]",
"moov_ci_phone_number": "0153401679",
"payment_token": "dzSNGqLCohvsFq9KlCmN"
}
{
"success": true,
"message": "Votre transaction a été validé avec succès.",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
When you make a payment by MOOV CI
, a popup automatically opens on your phone with a field for entering your secret code
for payment validation.
If the validation time exceeds 30 seconds
, the API returns the response below:
{
"success": false,
"message": "Vous avez dépassé le délais de validation de la transaction."
}
https://app.paydunya.com/api/v1/softpay/wave-ci
{
"wave_ci_fullName": "Fallou",
"wave_ci_email": "[email protected]",
"wave_ci_phone": "777777777",
"wave_ci_payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}
{
"success": true,
"message": "Rediriger vers cette URL pour completer le paiement.",
"url": "https://pay.wave.com/c/cos-1cj669hbr1350?a=200&c=XOF&m=JOE",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/orange-money-burkina
{
"name_bf": "Fallou",
"email_bf": "[email protected]",
"phone_bf": "76950976",
"otp_code": "89525",
"payment_token": "lLTs7h0tor82tchzvSec"
}
{
"success": true,
"message": "success message",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/moov-burkina
{
"moov_burkina_faso_fullName": "Fallou",
"moov_burkina_faso_email": "[email protected]",
"moov_burkina_faso_phone_number": "51765664",
"moov_burkina_faso_payment_token": "lLTs7h0tor82tchzvSec"
}
{
"success": true,
"message": "Veuillez compléter le paiement en composant le *555*6#.",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/moov-benin
{
"moov_benin_customer_fullname": "Camille",
"moov_benin_email": "[email protected]",
"moov_benin_phone_number": "0140253725",
"payment_token": "lLTs7h0tor82tchzvSec"
}
{
"success": true,
"message": "Success message",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/mtn-benin
{
"mtn_benin_customer_fullname": "Camille",
"mtn_benin_email": "[email protected]",
"mtn_benin_phone_number": "66414231",
"mtn_benin_wallet_provider": "MTNBENIN",
"payment_token": "lLTs7h0tor82tchzvSec"
}
{
"success": true,
"message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/t-money-togo
{
"name_t_money": "Camille",
"email_t_money": "[email protected]",
"phone_t_money": "70707070","
"payment_token": "lLTs7h0tor82tchzvSec"
}
{
"success": true,
"message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter.",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/moov-togo
{
"moov_togo_customer_fullname": "TEST",
"moov_togo_email": "[email protected]",
"moov_togo_customer_address": "DAKAR",
"moov_togo_phone_number": "12345678",
"payment_token": "ERtyuIrLouhhRHICF0HboN"
}
{
"success": true,
"message": "Transaction effectuée avec succès",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/orange-money-mali
{
"orange_money_mali_customer_fullname": "Camille",
"orange_money_mali_email": "[email protected]",
"orange_money_mali_phone_number": "90239415",
"orange_money_mali_customer_address" : "Bamako",
"payment_token": "9MHW084mlDTpExGW8OY4"
}
{
"success": true,
"message": "Paiement enregistré, en attente de confirmation du client"
}
https://app.paydunya.com/api/v1/softpay/moov-mali
{
"moov_ml_customer_fullname": "John Doe",
"moov_ml_email": "[email protected]",
"moov_ml_phone_number": "90239415",
"moov_ml_customer_address" : "Bamako",
"payment_token": "6KIFXkAiAU70uuam5Dix"
}
{
"success": true,
"message": "Merci de finaliser le paiement sur votre téléphone.",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency" : "XOF" // Si c'est le payeur qui supporte les frais.
}
https://app.paydunya.com/api/v1/softpay/paydunya
{
"customer_name": "John Doe",
"customer_email": "[email protected]",
"phone_phone": "77777777",
"password": "12345678",
"invoice_token": "lLTs7h0tor82tchzvSec"
}
{
"success": true,
"message": "Success message",
"fees" : 100, // Si c'est le payeur qui supporte les frais.
"currency": "XOF" // Si c'est le payeur qui supporte les frais.
}