Statut public
curl --request GET \
--url https://sandbox-api.caurisflux.com/api/v1/payments/public/status/{transactionId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://sandbox-api.caurisflux.com/api/v1/payments/public/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/public/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/public/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/public/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/public/status/{transactionId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.caurisflux.com/api/v1/payments/public/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 public
Vérifier le statut d un paiement sans authentification
GET
/
payments
/
public
/
status
/
{transactionId}
Statut public
curl --request GET \
--url https://sandbox-api.caurisflux.com/api/v1/payments/public/status/{transactionId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://sandbox-api.caurisflux.com/api/v1/payments/public/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/public/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/public/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/public/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/public/status/{transactionId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.caurisflux.com/api/v1/payments/public/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 d’un paiement sans authentification.
Cet endpoint ne nécessite pas d’authentification. Utilisez-le pour les pages de confirmation côté client.
Pour des raisons de sécurité, cet endpoint retourne des informations limitées.
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/public/status/TX000007272
Réponse
{
"transactionId": "TX000007272",
"status": "success",
"amount": 10000,
"currency": "XOF"
}
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é |
Utilisation côté client
// Vérification du statut après retour sur le site
async function checkPaymentStatus(transactionId) {
const response = await fetch(
`https://sandbox-api.caurisflux.com/api/v1/payments/public/status/${transactionId}`
);
const data = await response.json();
if (data.status === 'success') {
// Afficher message de succès
showSuccessMessage();
} else if (data.status === 'pending') {
// Paiement toujours en cours
showPendingMessage();
} else {
// Paiement échoué ou annulé
showErrorMessage();
}
}
Pour obtenir tous les détails d’un paiement (provider, metadata…), utilisez l’endpoint authentifié
GET /payments/status/:transactionId.⌘I