← Slimpay.ng

Used by every "Try It" panel across these docs to call app.slimpay.ng for real. Get one from Authentication — register or log in, then paste the token here. Stored only in this browser (localStorage), never sent anywhere but the Slimpay API, and auto-cleared after 8 hours.

SDKs

PHP School SDK

The School SDK connects your school's system (student portal, fee system, ERP) to Slimpay without hand-writing signature checks or payload parsing. The core is plain PHP 8.1+ with no runtime dependencies, so it works in Laravel, Symfony, CodeIgniter, Slim or a single index.php.

Install

bash
composer require hilinks/slimpay-school-sdk

Requires PHP 8.1+ and ext-json. ext-curl is needed if you use Client. Your endpoints must be public HTTPS URLs — Slimpay won't call loopback, private or non-HTTPS addresses, so use a tunnel such as ngrok for local development.

What it does

You want to…Use
Confirm a student ID while a parent paysLookupHandler::handleStudent()
Let Slimpay fetch an invoice's amount and studentLookupHandler::handleInvoice()
Get notified when a payment landsWebhookHandler
Start a payment for an invoice from your own portalClient::collectInvoice()
Plug all of this into LaravelSlimpayServiceProvider

Secrets

Four credentials are issued in your school portal. Each is shown once — store them in environment variables, never in git.

SecretWhere to get itUsed for
Student lookup secretSettings → Student LookupVerifying student lookup requests
Invoice lookup secretSettings → Invoice CollectionVerifying invoice lookup requests
Webhook secretWebhooks → Signing secretVerifying payment webhooks
API key (sandbox / live)Settings → API KeysCalling Slimpay with Client

Quick tour

php
use Slimpay\School\{Client, LookupHandler, WebhookHandler, WebhookEvent};

// 1. Slimpay asks YOUR system about a student (signed request, you answer).
$lookups = new LookupHandler($studentSecret, new MyStudents());
echo json_encode($lookups->handleStudent(file_get_contents('php://input'), getallheaders()));

// 2. Slimpay tells YOU a payment arrived.
(new WebhookHandler($webhookSecret))
    ->on('payment.received', fn (WebhookEvent $e) => markPaid($e->studentId(), $e->amount()))
    ->handle(file_get_contents('php://input'), getallheaders());

// 3. YOU ask Slimpay to collect an invoice.
$checkout = (new Client($apiKey))->collectInvoice('SCH-9K2H7XQZ', 'INV-8841', 'https://portal.example.edu.ng/return');
header('Location: ' . $checkout->url);

Lookups

Slimpay calls your server with a signed request when a parent types a student ID on checkout (student lookup) or when your portal calls collectInvoice() (invoice lookup). See Lookups.

Webhooks

WebhookHandler verifies the signature and dispatches payment.received to your listeners. See Webhooks.

Collect an invoice

See API Client.

Framework guides

Laravel is auto-discovered with routes provided — see Laravel. For Symfony, Slim, CodeIgniter, WordPress or plain PHP, see Other Frameworks.

Going live

  1. Register your public URLs in the school portal and enable lookups.
  2. Use Send Test Webhook on the Webhooks page and Test Connection in Settings.
  3. Make a small sandbox payment end to end.
  4. Swap the sandbox API key for the live key and confirm secrets are in your production environment.

See Testing, Security and Troubleshooting. Keep your server clock accurate (NTP): signed requests older than 5 minutes are rejected.