Project
Kora PHP & Laravel SDKs
A framework-agnostic PHP SDK and Laravel integration for Kora payments, designed around typed resources, predictable failures, verified webhooks, and testable application wiring.
Results and deliverables
- Published versioned PHP and Laravel packages on Packagist
- Covered collections, payouts, refunds, balances, conversions, chargebacks, and webhooks
- Created a framework-independent core with a Laravel-native integration layer
Overview
Kora PHP and Kora Laravel form a two-layer SDK for integrating the Kora payment API, formerly KoraPay. The core package works in any modern PHP application; the Laravel package adds framework-native configuration, service-container wiring, facade access, events, and optional webhook routing.
The separation keeps payment-domain behaviour independent of Laravel while giving Laravel teams an integration that follows the conventions they already use.
Published packages
- Core SDK: mosesadewale/kora-php · GitHub
- Laravel integration: mosesadewale/kora-laravel · GitHub
Both packages are versioned and publicly installable through Composer.
SDK architecture
The framework-independent package owns the API client, resource operations, data transfer objects, validation, transport behaviour, and payment-specific exception model. Its resources cover:
- Charges and mobile-money collections
- Payouts and bulk payouts
- Balances and currency conversions
- Refunds and chargebacks
- Pool accounts
- Webhook verification and parsing
The Laravel package builds on that core with:
- Package discovery and publishable configuration
- Service-container bindings and a
Korafacade - Environment and credential validation
- An optional webhook receiver with signature-verification middleware
- A generic Laravel event that preserves unknown future event types
- Interfaces that applications can replace with mocks in tests
Reliability decisions
Payment SDKs sit on a failure boundary, so the packages make operational behaviour explicit:
- Typed exceptions distinguish authentication, validation, duplicate references, insufficient funds, network failures, and provider errors.
- Retry and timeout behaviour are configurable rather than hidden.
- Webhook signatures are verified before events enter application code.
- Business processing, idempotency, queues, and irreversible decisions remain owned by the integrating application.
- The core package can be tested independently, while Laravel consumers can replace the client through the container.
Package boundary
The PHP SDK is the provider-facing foundation. The Laravel package is deliberately thin: it adapts the core to Laravel without duplicating payment logic. This makes the integration easier to maintain and leaves room for other framework adapters to share the same tested core.