Passer au contenu principal
Les tentatives sont imbriquées sous une intention. Accédez-y via $orqex->attempts().

Lister & récupérer

$page = $orqex->attempts()->all('TRX123', ['per_page' => 20]);

foreach ($page as $attempt) {
    $attempt->status;          // "processing" | "action_required" | "completed" | "failed" | "cancelled"
    $attempt->method->value;   // ex. "momo_mtn"
    $attempt->is_fallback;     // bool
}

$attempt = $orqex->attempts()->retrieve('TRX123', 'att_456');

Lire le résultat

$attempt = $intent->active_attempt;

if ($attempt?->status === 'action_required') {
    $action = $attempt->next_action;   // voir Actions suivantes
}

if ($attempt?->status === 'failed') {
    $attempt->failure['code'];     // un code d'échec stable
    $attempt->failure['message'];  // lisible par un humain
}

Méthodes

MéthodeRenvoie
all(string $intentId, array $params = [], $opts = null)Collection<PaymentAttempt>
retrieve(string $intentId, string $attemptId, $opts = null)PaymentAttempt
Voir les concepts Tentatives et Actions suivantes.