The official PHP SDK for Reevit— a unified payment orchestration platform for Africa.
# Reevit PHP SDK
The official PHP SDK for Reevit — a unified payment orchestration platform for Africa.
## Installation
```bash
composer require reevit/reevit-php:0.9.0
```
## Quick Start
```php
payments->createIntent([
'amount' => 5000, // 50.00 GHS
'currency' => 'GHS',
'method' => 'momo',
'country' => 'GH',
'customer_id' => 'cust_123',
'metadata' => [
'order_id' => '12345'
]
], 'order_12345');
echo "Payment created: " . $payment['id'] . "\n";
// List payments
$payments = $client->payments->list();
print_r($payments);
```
## Server-created checkout sessions
Create checkout sessions on your server, then pass `$session['session_secret']` to a browser SDK — `@reevit/react`, `@reevit/vue`, or `@reevit/svelte` — to render the checkout UI.
```php
$session = $client->checkoutSessions->create([
'amount' => 5000,
'currency' => 'GHS',
'method' => 'mobile_money',
'country' => 'GH',
], 'order_12345');
```
## Idempotency
Pass an idempotency key as the second argument to prevent duplicate intent creation.
```php
$intent = $client->payments->createIntent(
[
'amount' => 5000,
'currency' => 'GHS',
'method' => 'momo',
'country' => 'GH',
],
'order_12345'
);
```
## Features
- **Payments**: Create intents, update intents, confirm, confirm intent, cancel, retry, refund, stats
- **Connections**: Manage PSP integrations, validation, labels, status, audit
- **Subscriptions**: Manage recurring billing lifecycle
- **Fraud**: Configure fraud rules
- **Customers / Payment Links / Checkout Sessions / Webhooks / Routing Rules / Invoices**: Additional backend services
- **PSR-4 Autoloading**: Standard PHP structure
Passing `null` for `orgId` is still accepted for backward compatibility, but authenticated org-scoped requests should include it.
Use `$client->connections->listPage()` when pagination metadata matters, or
`$client->connections->listAll()` to fetch every connected PSP matching the
supplied filters.
---
## Webhook Verification
Reevit sends webhooks to notify your …