Endpoint
GET https://pay.sandbox.yabetoopay.com/v1/payment-intents/{id} # Sandbox
GET https://pay.api.yabetoopay.com/v1/payment-intents/{id} # Production
Authentification
Utilisez votre clé secrète dans l’en-têteAuthorization :
Authorization: Bearer YOUR_SECRET_KEY
Paramètres de chemin
| Paramètre | Type | Description |
|---|---|---|
id | string | L’ID de l’intention de paiement |
Exemple de requête
curl https://pay.sandbox.yabetoopay.com/v1/payment-intents/pi_XdLeavDjiiaEx2y5nRz0 \
-H "Authorization: Bearer YOUR_SECRET_KEY"
import Yabetoo from "@yabetoo/sdk-js";
const yabetoo = new Yabetoo("YOUR_SECRET_KEY");
const paymentIntent = await yabetoo.payments.retrieve("pi_XdLeavDjiiaEx2y5nRz0");
from yabetoo import Yabetoo
yabetoo = Yabetoo("YOUR_SECRET_KEY")
payment_intent = yabetoo.payments.retrieve("pi_XdLeavDjiiaEx2y5nRz0")
<?php
require 'vendor/autoload.php';
use Yabetoo\Yabetoo;
$yabetoo = new Yabetoo("YOUR_SECRET_KEY");
$paymentIntent = $yabetoo->payments->retrieve("pi_XdLeavDjiiaEx2y5nRz0");
import com.yabetoo.Yabetoo;
import com.yabetoo.YabetooConfig;
import com.yabetoo.model.PaymentIntent;
YabetooConfig config = new YabetooConfig()
.setApiKey("YOUR_SECRET_KEY");
Yabetoo yabetoo = new Yabetoo(config);
PaymentIntent paymentIntent = yabetoo.paymentIntents().retrieve("pi_XdLeavDjiiaEx2y5nRz0");
Réponse
200 OK
{
"amount": 2000,
"currency": "xaf",
"label": "payment_intent",
"id": "pi_XdLeavDjiiaEx2y5nRz0",
"status": "succeeded",
"client_secret": ""
}
Statuts de l’intention de paiement
| Statut | Description |
|---|---|
requires_payment_method | En attente de méthode de paiement |
requires_confirmation | En attente de confirmation |
processing | Paiement en cours de traitement |
succeeded | Paiement réussi |
failed | Paiement échoué |
canceled | Paiement annulé |
404 Not Found
{
"message": "Payment intent not found"
}
401 Unauthorized
{
"error": "Unauthorized"
}