Passer au contenu principal
Accédez au service via $orqex->paymentIntents(). Chaque méthode renvoie un PaymentIntent typé (ou une Collection pour all).

Créer

$intent = $orqex->paymentIntents()->create([
    'amount'      => 50,            // unités majeures
    'currency'    => 'XOF',
    'description' => 'Commande #1024',
    'customer'    => ['email' => '[email protected]', 'first_name' => 'Ama', 'last_name' => 'Mensah'],
    'metadata'    => ['order_id' => '1024'],
    // optionnel : démarrer un paiement dans le même appel
    'attempt'     => ['method_code' => 'momo_mtn', 'country' => 'CI', 'phone' => ['number' => '0700000000', 'country' => 'CI']],
]);

Récupérer

$intent = $orqex->paymentIntents()->retrieve('TRX123');

$intent->status;            // "pending" | "completed" | "failed" | ...
$intent->amount->value;     // unités mineures
$intent->customer->email;
$intent->active_attempt;    // PaymentAttempt|null

Lister

$page = $orqex->paymentIntents()->all([
    'status'   => 'completed',
    'channel'  => 'api',
    'per_page' => 50,
]);

foreach ($page->autoPagingIterator() as $intent) { /* ... */ }
Accepte status, channel, customer_id, created_at[gte], created_at[lte], per_page. Voir pagination.

Tentative, confirmation, capture

// Démarrer une tentative
$intent = $orqex->paymentIntents()->attempt('TRX123', [
    'method_code' => 'momo_mtn',
    'country'     => 'CI',
    'phone'       => ['number' => '0700000000', 'country' => 'CI'],
]);

// Confirmer une tentative qui requiert une action (ex. OTP)
$intent = $orqex->paymentIntents()->confirm('TRX123', ['otp' => '123456']);
capture() vise un endpoint pas encore disponible et lève NotImplementedException (HTTP 501). Il est exposé pour que votre intégration soit prête le jour venu.

Méthodes

MéthodeRenvoie
create(array $params, $opts = null)PaymentIntent
all(array $params = [], $opts = null)Collection<PaymentIntent>
retrieve(string $id, $opts = null)PaymentIntent
attempt(string $id, array $params, $opts = null)PaymentIntent
confirm(string $id, array $params = [], $opts = null)PaymentIntent
capture(string $id, array $params = [], $opts = null)lève NotImplementedException