Initiating a payment


How to generate a payment link

To initialize a payment you need to generate a payment link by sending the following information in JSON. Using this url: https://api.epaycs.com/v2/payment

Variable name Type Size Required Description
apikey String - Yes your apikey(provided by DV PASS)
site_id String - Yes your site_id(provided by DV PASS)
transaction_id String - Yes Transaction identification (unique)
amountnote Integer - Yes The amount of the transaction must be a multiple of 5)
currency String 3 Yes The currency (XOF, XAF, CDF, GNF, USD)
description String - Yes Description of the current payment
notify_url Url - Yes The payment notification link
return_url Url - Yes The link where the customer will be redirected after the payment
channels String - Yes Used to define the universes present on the counter (ALL, MOBILE_MONEY, CREDIT_CARD, WALLET). By default, channels is ALL
lang String - No the default language of the payment gateway (fr, en)
metadata String - No any other additional information, generally you will put values you need to identify or process the payment easily, example: the order reference
invoice_data Object 3 Non Any additional information you want to display on the DV PASS invoice (Supports three variables that you name at your convenience)Example
alternative_currencynote String 3 No Value of the transaction in the currency chosen by the Merchant

{primary.fa-info}To display the credit card payment option, you must add to the previous information this optional information

Variable name Type Size Required Description
customer_id String - No The customer's identifier in your system
customer_name String - Yes The name of the customer
customer_surname String - Yes The customer's first name
customer_phone_number String - Yes customer's phone number
customer_email String - Yes customer's email
customer_address String - Yes the customer's address
customer_city String - Yes customer's city
customer_country String 2 Yes The country of the customer, the value to be sent is the ISO code of the country (two digit code) ex : CI, BF, US, CA, FR
customer_state String 2 Yes The state in which the customer is located. This value is mandatory if the customer is located in the United States of America (US) ou au Canada (CA)
customer_zip_code String 5 Yes The client's postal code


After getting the payment url from the previous request, you just need to launch this url in a web browser to get to the payment counter.

Initialisation

{primary.fa-close}For more security, the payment information must be saved in the database before displaying the counter.

Example of integration

Example of query

{
  "amount": 2500,
  "currency": "XOF",
  "apikey": "XXXXXXXXXXXXXXXX",
  "site_id": "XXXXX",
  "transaction_id": "REFID12354",
  "description": "TRANSACTION DESCRIPTION", 
  "return_url": "https://www.exemple.com/return", 
  "notify_url": "https://www.exemple.com/notify", 
  "metadata": "user001",
  "customer_id": "001",
  "customer_name": "John",
  "customer_surname": "Doe",
  "channels": "MOBILE_MONEY"
}

Example of a successful response

{
    "code": "201",
    "message": "CREATED",
    "description": "Transaction created with success",
    "data": {
        "payment_token": "5df64dd9c5447739327eb88e1e4ea0ac015555cc262ea308c91acbd4e5c8fb95f4bd0bd7cad877a452f877fa6f51fe74184d00a84ab7f9",
        "payment_url": "https://cs.epaycs.com/payment/499b3b86dd7b1b071db6192d58485cf938886c8941da286e5273567fe6168e2659ac038393d5c53f90807594d186392e4cb59da04c8314"
    },
    "api_response_id": "1632143554.8513"
}

Example of an error response

{
    "code": "ERROR_CODE",
    "message": "ERROR_MESSAGE ",
    "description": "ERROR_DESCRIPTION", 
    "api_response_id": "RESPONSE_ID_HERE"
}

Good to know

1) amount : The amount must be a multiple of 5 or the transaction will fail. This restriction is not applied to the currency USD.


2) alternative_currency : This conversion is for information purposes only. DV PASS is not responsible for any additional fees applicable to the transaction


3) invoice_data


"invoice_data":{
                "Reste à payer":"25 000fr",
                "Matricule":"24OPO25",
                "Annee-scolaire":"2020-2021"
               }