Sandbox SoftPay


DEFINITION

In order to test our SoftPay API, you’ll need to generate:

  • A test invoice : it will provide to you an invoice token;
  • Your API Test Keys : will be used to fill your headers;
  • At least one fictitious customer account or test account : we shall need its email address your phone number;

GENERATION OF PAYMENT TOKEN

SANDBOX INVOICE TOKEN

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


REQUEST HTTP POST


curl -H "Content-Type: application/json" \
-H "PAYDUNYA-MASTER-KEY: wQzk9ZwR-Qq9m-0hD0-zpud-je5coGC3FHKW" \
-H "PAYDUNYA-PRIVATE-KEY: test_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/sandbox-api/v1/checkout-invoice/create"

EXPECTED RESPONSE


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

Trick


To receive the complete payment information structure, you can make a request with the received token in the above response.

MAKE PAYMENT


SANDBOX SOFTPAY

https://app.paydunya.com/sandbox-api/v1/softpay/checkout/make-payment


REQUEST HTTP POST


{
    "phone_phone": "97403627",
     "customer_email": "[email protected]",
     "password": "Miliey@2121",
     "invoice_token": "test_6BaZCm7FXS"
}


Note


  • phone_phone : is a test account phone number.

  • customer_email : is a test account email address.

  • password : is the test account password.

  • invoice_token : is the token you got after generating your test invoice


Expected Response


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

In cases the "success" key is set to "false" , please, make sure

  • the invoice you’re trying to settle is not already completed
  • you provided a correct invoice token
  • you’re using a test account