SOFTPAY


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.

GENERATION OF API KEYS

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:

  • First you need have a PayDunya Business account activated. Create one if it is not yet the case.
  • Login to your account and click on Integration API at the menu level on the left.
  • Click on the button Set up a new application and fill out the form.
  • Choose Test mode, I want to make payment tests and Enable production mode.

API integration


ENDPOINTS API LIVE

https://app.paydunya.com/api/v1/checkout-invoice/create


POST REQUEST HTTP


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"

EXPECTED RESPONSE


{
    "response_code":"00",
    "response_text":"https://app.paydunya.com/checkout/invoice/ERtyuILouhhRHICF0HboN",
    "description":"Checkout Invoice Created",
    "token":"ERtyuILouhhRHICF0HboN"
}

1 - Complete JSON structure of the data to be sent


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": ""
        }
      }
}

2 - Adding items to the PayDunya invoice


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": ""
        }
}

3 - Add taxes (optional)


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
    }
}

4 - Adding custom data (optional)


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}


Exemple 1


"custom_data": {
    "categorie": "Jeu concours",
    "periode":  "Noël 2015",
    "numero_gagnant": 5,
    "prix" : "Bon de réduction de 50%"
}

Exemple 2


"custom_data": {
    "phone_brand": "Nokia",
    "IMEI": "72892821010728",
    "model": "Luna"
}

5 - IPN configuration (Instant Payment Notification)


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.


Expected Response:


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' => 'aliounefaye@gmail.com',
        ),
      '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.

Payment by 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#


ORANGE MONEY SENEGAL API

https://app.paydunya.com/api/v1/softpay/orange-money-senegal


REQUEST HTTP POST


{
  "customer_name": "Fallou",
  "customer_email": "test@gmail.com",
  "phone_number": "778676477",
  "authorization_code": "152347",
  "invoice_token": "GS46gkCAnRv3WfRwFdJU"
}
  • "customer_name": This is the name of the payer
  • "customer_email": This is the email of the payer
  • "phone_number": This is the payer phone number
  • "authorization_code":This is the USSD code generated by the payer
  • "invoice_token": This is the payment TOKEN generated above


Expected Response


{
  "success": true,
  "message": "Transaction éffectué avec succés"
}

Payment by FREE MONEY


FREE MONEY API

https://app.paydunya.com/api/v1/softpay/free-money-senegal


REQUEST HTTP POST


{
  "customer_name": "Fallou",
  "customer_email": "test@gmail.com",
  "phone_number": "768690999",
  "payment_token": "GS46gkCAnRv3WfRwFdJU"
}


Expected Response


{
  "message": "Opération réussi, Veuillez tapez #150# pour finaliser votre paiement",
  "data": {
    "status": "PENDING",
    "amount": 200,
    "currency": "XOF",
    "customermsisdn": 768690999,
    "transactionid": "MP210921.1230.B04577",
    "externaltransactionid": "FM076_93108370"
  },
  "success": true
}

Payment by EXPRESSO


EXPRESSO API

https://app.paydunya.com/api/v1/softpay/expresso-senegal


REQUEST HTTP POST


{
  "expresso_sn_fullName": "Fallou",
  "expresso_sn_email": "test@gmail.com",
  "expresso_sn_phone": "705189525",
  "payment_token": "GS46gkCAnRv3WfRwFdJU"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter."
}

Payment by WAVE


WAVE API

https://app.paydunya.com/api/v1/softpay/wave-senegal


REQUEST HTTP POST


{
  "wave_senegal_fullName": "Fallou",
  "wave_senegal_email": "test@gmail.com",
  "wave_senegal_phone": "77777777",
  "wave_senegal_payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter."
}

Payment by ORANGE MONEY CÔTE D'IVOIRE


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


ORANGE MONEY CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/orange-money-ci


REQUEST HTTP POST

{
  "orange_money_ci_customer_fullname": "John Doe",
  "orange_money_ci_email": "test@gmail.com",
  "orange_money_ci_phone_number": "0777568646",
  "orange_money_ci_otp": "8562",
  "payment_token": "ljUZxD5T3RRxhpoOl66b"
}


Expected Response

{
    "success": true,
    "message": "Paiement effectuée avec succès."
}

Payment by MTN CÔTE D'IVOIRE


MTN CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/mtn-ci


REQUEST HTTP POST


{
  "mtn_ci_customer_fullname": "Fallou",
  "mtn_ci_email": "test@gmail.com",
  "mtn_ci_phone_number": "664142312",
  "mtn_ci_wallet_provider": "MTNCI",
  "payment_token": "OnW1IkMIQDTiJnQ9S3Ix"
}


Expected Response


{
  "success": true,
  "message": "success message"
}

Payment by ORANGE MONEY BURKINA FASO


ORANGE MONEY BURKINA FASO API

https://app.paydunya.com/api/v1/softpay/orange-money-bf


REQUEST HTTP POST


{
  "name_bf": "Fallou",
  "email_bf": "test@gmail.com",
  "phone_bf": "76950976",
  "otp_code": "89525",
  "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "success message"
}

Payment by MOOV BURKINA FASO


MOOV BURKINA FASO API

https://app.paydunya.com/api/v1/softpay/moov-burkina


REQUEST HTTP POST


{
  "moov_burkina_faso_fullName": "Fallou",
  "moov_burkina_faso_email": "test@gmail.com",
  "moov_burkina_faso_phone_number": "51765664",
  "moov_burkina_faso_payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Veuillez compléter le paiement en composant le *555*6#."
}

Payment par Moov BENIN


MOOV BENIN API

https://app.paydunya.com/api/v1/softpay/moov-benin


REQUEST HTTP POST


{
   "moov_benin_customer_fullname": "Camille",
   "moov_benin_email": "camillemilly7@gmail.com",
   "moov_benin_phone_number": "0140253725",
   "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Success message"
}

Payment by MTN BENIN


MTN BENIN API

https://app.paydunya.com/api/v1/softpay/mtn-benin


REQUEST HTTP POST


{
  "mtn_benin_customer_fullname": "Camille",
  "mtn_benin_email": "camillemilly7@gmail.com",
  "mtn_benin_phone_number": "66414231",
  "mtn_benin_wallet_provider": "MTNBENIN",
  "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter"
}

Payment by PAYDUNYA


PAYDUNYA API

https://app.paydunya.com/api/v1/softpay/paydunya


REQUEST HTTP POST


{
  "customer_name": "Fallou",
  "customer_email": "exemple@paydunya.com",
  "phone_phone": "77777777",
  "password": "12345678",
  "invoice_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Success message"
}

Payment by T-MONEY


T-MONEY API

https://app.paydunya.com/api/v1/softpay/t-money-togo


REQUEST HTTP POST


{
  "name_t_money": "Camille",
  "email_t_money": "exemple@paydunya.com",
  "phone_t_money": "70707070","
  "payment_token": "lLTs7h0tor82tchzvSec"
}


Expected Response


{
  "success": true,
  "message": "Votre paiement est en cours de traitement. Merci de valider le paiement après reception de sms pour le compléter."
}

Payment by MOOV CÔTE D'IVOIRE


MOOV CÔTE D'IVOIRE API

https://app.paydunya.com/api/v1/softpay/moov-ci


REQUEST HTTP POST


{
    "moov_ci_customer_fullname": "Camille",
    "moov_ci_email": "camillemilly7@gmail.com",
    "moov_ci_phone_number": "0153401679",
    "payment_token": "dzSNGqLCohvsFq9KlCmN"
}


Expected Response


{
    "success": true,
    "message": "Votre transaction a été validé avec succès."
}

Note


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:


Expected Response


{
    "success": false,
    "message": "Vous avez dépassé le délais de validation de la transaction."
}