Statut du paiement
curl --request GET \
--url https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyPaiements
Statut du paiement
Vérifier le statut d un paiement
GET
/
payments
/
status
/
{transactionId}
Statut du paiement
curl --request GET \
--url https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.caurisflux.com/api/v1/payments/status/{transactionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyVérifie le statut actuel d’un paiement.
Authentification
X-API-Key: pk_test_xxx:sk_test_xxx
Paramètres de chemin
| Paramètre | Type | Description |
|---|---|---|
transactionId | string | ID de transaction retourné lors de l’initiation |
Requête
curl https://sandbox-api.caurisflux.com/api/v1/payments/status/TX000007272 \
-H "X-API-Key: pk_test_xxx:sk_test_xxx"
Réponse - Paiement complété
{
"transactionId": "TX000007272",
"merchantReference": "COMMANDE-12345",
"type": "collect",
"status": "success",
"amount": 10000,
"currency": "XOF",
"provider": "wave",
"customerPhone": "+221771234567",
"customerName": "Amadou Diallo",
"customerEmail": "amadou@example.com",
"message": "Paiement effectué avec succès",
"errorCode": null,
"errorMessage": null,
"expiresAt": null,
"completedAt": "2024-01-15T12:05:30.000Z",
"createdAt": "2024-01-15T12:00:00.000Z",
"updatedAt": "2024-01-15T12:05:30.000Z",
"metadata": {
"orderId": "12345",
"description": "Achat sur MaBoutique.sn"
}
}
Réponse - Paiement en attente
{
"transactionId": "TX000007272",
"merchantReference": "COMMANDE-12345",
"type": "collect",
"status": "pending",
"amount": 10000,
"currency": "XOF",
"provider": "wave",
"customerPhone": "+221771234567",
"customerName": "Amadou Diallo",
"customerEmail": null,
"message": "Paiement en attente",
"errorCode": null,
"errorMessage": null,
"expiresAt": "2024-01-15T12:30:00.000Z",
"completedAt": null,
"createdAt": "2024-01-15T12:00:00.000Z",
"updatedAt": "2024-01-15T12:00:00.000Z",
"metadata": null
}
Réponse - Paiement échoué
{
"transactionId": "TX000007272",
"merchantReference": "COMMANDE-12345",
"type": "collect",
"status": "failed",
"amount": 10000,
"currency": "XOF",
"provider": "wave",
"customerPhone": "+221771234567",
"customerName": "Amadou Diallo",
"customerEmail": "amadou@example.com",
"message": "Paiement échoué",
"errorCode": "insufficient_funds",
"errorMessage": "Solde insuffisant sur le compte Wave",
"expiresAt": null,
"completedAt": null,
"createdAt": "2024-01-15T12:00:00.000Z",
"updatedAt": "2024-01-15T12:02:00.000Z",
"metadata": {
"orderId": "12345",
"description": "Achat sur MaBoutique.sn"
}
}
Statuts possibles
| Statut | Description |
|---|---|
pending | En attente de paiement |
processing | Paiement en cours de traitement |
success | Paiement réussi |
failed | Paiement échoué |
cancelled | Paiement annulé |
expired | Paiement expiré |
refunded | Paiement remboursé |
Codes d’erreur
| Code | Description |
|---|---|
insufficient_funds | Solde insuffisant |
user_cancelled | Annulé par l’utilisateur |
timeout | Délai expiré |
provider_error | Erreur du provider |
invalid_phone | Numéro invalide |
⌘I