API — WinDev

WinDev integration

Integrate XPAYE into your WinDev applications. A native solution to initialize payments directly from your Windows applications.

Integration example

WinDev code

payment.wdl
cMyRequest is restRequest
cMyRequest..URL = "https://www.paiementpro.net/webservice/onlinepayment/init/curl-init.php"
cMyRequest..Méthode = httpPost
cMyRequest..ContentType = "application/json"

cMyRequest.Contenu = ChaîneConstruit("{""merchantId"": ""ID MARCHAND"",""description"": ""Api Windev"",""amount"": ""1000"",""channel"": ""CARD"",""countryCurrencyCode"": ""952"",""referenceNumber"": ""123456789"",""customerEmail"": ""client@example.com"",""customerFirstName"": ""Jean"",""customerLastname"": ""Dupont"",""customerPhoneNumber"": ""0102030405"",""notificationURL"": ""https://votre-site.com/webhook"",""returnURL"": ""https://votre-site.com/retour"",""returnContext"": ""id:1""}")

cMyResponse is restResponse = RESTEnvoie(cMyRequest)

decodeResponse est un JSON

IF ErreurDétectée THEN
    Error(ErrorInfo(errComplet))
ELSE
    decodeResponse = cMyResponse..Content
    
    IF(cMyResponse..StatusCode) = "200" THEN
        // Succès: récupérer l'URL de paiement
        // urlPaiement = decodeResponse["url"]
        // OuvrirURL(urlPaiement)
    END 
END
API responses

JSON response examples

Success response

response.json
{
  "success": true,
  "message": "Initialisation effectuée avec succès",
  "url": "https://sandbox.paiementpro.net/sandbox.php?sessionid=1234567890"
}

Error response

response.json
{
  "success": false,
  "message": "Echec de l'initialisation"
}
Documentation

Paramètres de l'API

Paramètres d'envoi

ParamètreTypeDescription
merchantIdstringVotre ID Marchand (ex: PP-F324)
amountintMontant de la transaction
descriptionstringDescription du paiement (obligatoire)
channelstringMode de paiement (CARD, OMCIV2, MOMOCI, WAVECI, etc.)
countryCurrencyCodestringCode devise (ex: 952 pour XOF)
referenceNumberstringRéférence unique de la transaction (obligatoire)
customerEmailstringEmail du client (obligatoire)
customerFirstNamestringPrénom du client (obligatoire)
customerLastnamestringNom du client (obligatoire)
customerPhoneNumberstringTéléphone du client (obligatoire)
notificationURLstringURL de webhook pour notifications
returnURLstringURL de redirection après paiement
returnContextstringDonnées additionnelles (JSON)

Paramètres de réponse

ParamètreTypeDescription
merchantIdstringIdentifiant unique du partenaire
referenceNumberstringRéférence de la transaction
amountintMontant de la transaction
transactiondtstringDate et heure de la transaction
customerIdstringIdentifiant du client
returnContextstringDonnées transmises au partenaire
hashcodestringChaîne cryptée pour sécurité
responsecodestring0 = Réussi, -1 = Échoué