Server SDKs
PHP
A server SDK for charges, payouts and webhook verification. Coming soon.
Coming soon
This library is not published yet. The REST API it will wrap works today; the example below calls it directly.
What it will do
- Create and fetch charges and payouts from Laravel, Symfony or plain PHP.
- Check that a webhook came from us in one call, before you act on it.
Until then
Call the API directly with PHP's built-in curl functions. This creates a test charge of 5,000 RWF from an MTN
wallet, with your test key in INVERSEPAY_TEST_KEY:
<?php
$ch = curl_init('https://api.inversepay.app/api/b/v1/charges');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('INVERSEPAY_TEST_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'idempotency_key' => 'order-1001',
'amount_minor' => 500000,
'currency' => 'RWF',
'payer' => ['phone_number' => '250788123456', 'network' => 'MTN', 'country_code' => 'RW'],
]),
]);
$charge = json_decode(curl_exec($ch), true);The Quickstart covers the response and what happens next, and the API reference lists every field.
Want it sooner?
Tell us at developers@inversepay.app.