Access the service via $orqex->paymentIntents(). Every method returns a typed
PaymentIntent (or a Collection for all).
Create
$intent = $orqex->paymentIntents()->create([
'amount' => 50, // major units
'currency' => 'XOF',
'description' => 'Order #1024',
'customer' => ['email' => '[email protected]', 'first_name' => 'Ama', 'last_name' => 'Mensah'],
'metadata' => ['order_id' => '1024'],
// optional: start a payment in the same call
'attempt' => ['method_code' => 'momo_mtn', 'country' => 'CI', 'phone' => ['number' => '0700000000', 'country' => 'CI']],
]);
Retrieve
$intent = $orqex->paymentIntents()->retrieve('TRX123');
$intent->status; // "pending" | "completed" | "failed" | ...
$intent->amount->value; // minor units
$intent->customer->email;
$intent->active_attempt; // PaymentAttempt|null
List
$page = $orqex->paymentIntents()->all([
'status' => 'completed',
'channel' => 'api',
'per_page' => 50,
]);
foreach ($page->autoPagingIterator() as $intent) { /* ... */ }
Supports status, channel, customer_id, created_at[gte], created_at[lte],
per_page. See pagination.
Attempt, confirm, capture
// Start a payment attempt
$intent = $orqex->paymentIntents()->attempt('TRX123', [
'method_code' => 'momo_mtn',
'country' => 'CI',
'phone' => ['number' => '0700000000', 'country' => 'CI'],
]);
// Confirm an attempt that requires action (e.g. OTP)
$intent = $orqex->paymentIntents()->confirm('TRX123', ['otp' => '123456']);
capture() targets an endpoint that is not yet available and throws
NotImplementedException (HTTP 501). It is exposed so your integration is ready when it
ships.
Methods
| Method | Returns |
|---|
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) | throws NotImplementedException |