oussamamadjmaa / sofizpay-laravel
A Laravel wrapper for the SofizPay API — CIB card payments and prepaid service operations (phone, internet, game recharge, bill payments) for Algeria, with typed DTOs, response objects, and built-in sandbox mocking.
Package info
github.com/oussamamadjmaa/sofizpay-laravel
pkg:composer/oussamamadjmaa/sofizpay-laravel
Requires
- php: ^8.1
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^11.1
- pestphp/pest: ^4.7
- phpstan/phpstan: ^2.2
README
A Laravel package for SofizPay CIB transactions and service operations. It provides DTOs for phone, internet, game, and bill operations, plus typed response objects.
Requirements
- PHP 8.1 or later
- Laravel 10, 11, 12, or 13
Installation
composer require oussamamadjmaa/sofizpay-laravel
The package is discovered automatically. Publish its configuration when you need to set values in a config file:
php artisan vendor:publish --provider="OussamaMadjmaa\SofizPay\SofizPayServiceProvider" --tag=config
Set the required environment variables:
SOFIZPAY_ACCOUNT_ID= SOFIZPAY_ENCRYPTED_SK= SOFIZPAY_SANDBOX=true
Quick start
use OussamaMadjmaa\SofizPay\DTOs\MakeCIBTransactionDTO; use OussamaMadjmaa\SofizPay\SofizPay; $payment = app(SofizPay::class)->cibTransaction()->make( new MakeCIBTransactionDTO( amount: 2500, fullName: 'Oussama Madjmaa', phone: '0555123456', email: 'oussama@example.com', returnUrl: 'https://example.com/payments/return', ), ); return redirect()->away($payment->paymentUrl);
You may also use the OussamaMadjmaa\SofizPay\Facades\SofizPay facade.
Documentation
- Installation
- Configuration
- CIB transactions
- Service operations
- Sandbox behavior
- Error handling
- Architecture
Security
Please report vulnerabilities according to our security policy.
Contributing
Contributions are welcome. Read CONTRIBUTING.md and CODE_OF_CONDUCT.md first.
License
SofizPay for Laravel is open-sourced software licensed under the MIT license.