Skip to main content
Attempts are nested under a payment intent. Access them via $orqex->attempts().

List & retrieve

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

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

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

Reading the outcome

$attempt = $intent->active_attempt;

if ($attempt?->status === 'action_required') {
    $action = $attempt->next_action;   // see Next actions
}

if ($attempt?->status === 'failed') {
    $attempt->failure['code'];     // a stable failure code
    $attempt->failure['message'];  // human-readable
}

Methods

MethodReturns
all(string $intentId, array $params = [], $opts = null)Collection<PaymentAttempt>
retrieve(string $intentId, string $attemptId, $opts = null)PaymentAttempt
See the Payment attempts and Next actions concepts.