rohama / koin-sadad
Koin — SADAD (Bank Melli) gateway driver (REST WebAPI v0)
2.2.1
2026-10-23 09:11 UTC
Requires
- php: ^8.0
- rohama/koin-core: ^2.2.1
Requires (Dev)
- phpunit/phpunit: ^9.6 || ^10.5 || ^11.5 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-23 17:47:33 UTC
README
The SADAD gateway driver (Bank Melli) for the Koin package — built on SADAD's REST WebAPI v0.
Install
composer require rohama/koin-sadad
Features
- Payment request — returns token + redirect URL
- Verify
- Callback parsing
Per SADAD's official docs, this API version offers no refund/inquiry/sandbox APIs; the related capabilities are not implemented.
Configuration
| Field | Description |
|---|---|
apiKey |
API key |
merchantId |
Merchant id |
terminalKey |
Terminal key |
Usage
use Rohama\Koin\Sadad\SadadGateway; use Rohama\Koin\Support\PaymentStatus; $gateway = new SadadGateway( 'api-key', 'https://example.com/callback', extra: [ 'merchantId' => '…', 'terminalKey' => '…', ], ); $payment = $gateway->request(150000, 'ORDER-1', 'Subscription purchase'); if ($payment->isSuccessful()) { header('Location: ' . $payment->redirectUrl); exit; } // In the callback page — parseCallback runs verify() before reporting success $callback = $gateway->parseCallback($_GET, $_POST); if ($callback->status === PaymentStatus::SUCCESS) { // Verified }
refund()(in gateways that offer Refund) is available only when the developer-only 5th constructor parameter (refundable) is enabled.
Full documentation: https://rohamaa.github.io/Koin-Core/