hilinks / slimpay-school-sdk
Connect your school system to Slimpay: verify signed lookup requests, answer student/invoice lookups and handle payment webhooks.
dev-main
2026-11-03 19:17 UTC
Requires
- php: ^8.1
- ext-json: *
Requires (Dev)
- illuminate/http: ^10.0 || ^11.0 || ^12.0
- illuminate/routing: ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0
- phpunit/phpunit: ^10.5 || ^11.0
Suggests
- illuminate/support: Required for the Laravel service provider and auto-registered routes (^10|^11|^12).
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-03 19:17:52 UTC
README
Connect your school's system (student portal, fee system, ERP) to Slimpay without hand-writing signature checks and payload parsing.
| You want to… | Use | Guide |
|---|---|---|
| Confirm a student ID while a parent pays | LookupHandler::handleStudent() |
Lookups |
| Let Slimpay fetch an invoice's amount and student | LookupHandler::handleInvoice() |
Lookups |
| Get notified when a payment lands | WebhookHandler |
Webhooks |
| Start a payment for an invoice from your own portal | Client::collectInvoice() |
API client |
| Plug all of this into Laravel in minutes | SlimpayServiceProvider |
Laravel |
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
composer require hilinks/slimpay-school-sdk
60-second tour
use Slimpay\School\{Client, LookupHandler, WebhookHandler, WebhookEvent}; use Slimpay\School\Contracts\{StudentLookup, InvoiceLookup}; // 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);
The big picture
┌───────────────┐ 3. collectInvoice() ┌──────────┐
│ Your portal │ ─────────────────────▶ │ │
│ (school sys.) │ ◀───────────────────── │ Slimpay │
│ │ checkout URL │ │
│ │ ◀───── 1/2. signed ─── │ │
│ │ lookups (you reply) │ │
│ │ ◀───── 4. webhook ──── │ │
└───────────────┘ payment.received └──────────┘
Three secrets are involved, all issued in the Slimpay school portal:
| Secret | Where to get it | Used for |
|---|---|---|
| Student lookup secret | Settings → Student Lookup | Verifying student lookup requests |
| Invoice lookup secret | Settings → Invoice Collection | Verifying invoice lookup requests |
| Webhook secret | Webhooks → Signing secret | Verifying payment webhooks |
| API key (sandbox / live) | Settings → API Keys | Calling Slimpay (Client) |
Secrets are shown once. Store them in environment variables, never in git.
Documentation
- Getting started: the end-to-end setup checklist
- Lookups: student and invoice lookup endpoints
- Webhooks: payload reference, idempotency, retries
- API client:
collectInvoice()and error codes - Laravel: zero-boilerplate integration
- Other frameworks: plain PHP, Symfony, Slim
- Security: how signing works and what to protect
- Testing: sign requests locally, unit-test your handlers
- Troubleshooting & FAQ
- Changelog
License
MIT, see LICENSE.