alsharie / sabacash-payment
SabaCash payment gateway
1.1
2023-12-17 08:36 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.5
- illuminate/support: >=9.33
This package is auto-updated.
Last update: 2025-04-26 09:27:04 UTC
README
laravel package for SabaCash payment getway
install the package
composer require alsharie/sabacash-payment
You can publish using the following command
php artisan vendor:publish --provider="Alsharie\SabaCashPayment\SabaCashServiceProvider"
When published, the config/sabaCash.php
config file contains:
return [ 'auth' => [ 'username' => env('SABACASH_MERCHANT_USERNAME'), 'password' => env('SABACASH_MERCHANT_PASSWORD'), ], 'url' => [ 'base' => env('SABACASH_BASE_URL', 'https://api.sabacash.ye:49901'), ] ];
login
$sabaCash = new SabaCash(); $response = $sabaCash->login(); if ($response->isSuccess()) { $response->getToken(); }
To purchase using SabaCash payment
1. Purchase
$sabaCash = new SabaCash(); $response = $sabaCash ->setCurrency(2) ->setNote('this is simple note') ->setAmount(3000) ->setBeneficiaryTerminal(1) ->setSourceCode(/*phone number*/) ->initPayment(); if ($response->isSuccess()) { $response->getAdjustment(); ... ... }
2. Confirm purchase
$sabaCash = new SabaCash(); $response = $sabaCash ->setAdjustmentId(603414) ->setOtp(5761) ->setOperationApprove() ->setNote('تاكيد عملية الدفع') ->confirmPayment(); if ($response->isSuccess()) { return $response->getTransactionId(); }
3. Check Transaction Status
$sabaCash = new SabaCash(); $response = $sabaCash ->setTransactionId(/*tranId*/) ->checkTransactionStatus(); if ($response->isSuccess()) { return $response->getStatus(); }
you can get the full response body using $response->body()
for all requests