hesabe / payment
Hesabe Payment Package allows you to use the Payment API to accept payments in Kuwait
Requires
- php: >=7.0.0
- ext-curl: *
- ext-json: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: 4.*
- roave/security-advisories: dev-master
- symfony/var-dumper: 2.*
README
Hesabe Payment Package is a PHP package designed to integrate Hesabe Payment Gateway in your application in the easiest way possible.
Get in touch with Hesabe Support to get credentials in order to use this package.
Requirements
- Minimum PHP 7.0+ required
- Composer installed globally
Installation
-
Run the following command in the root of your PHP project:
composer require hesabe/payment
-
Import the
Payment
class in the file you want to use this package.use Hesabe\Payment\Payment;
-
Initialise the
Hesabe
instance usingPayment
class. You need to pass the credentials in the class parameters.$hesabe = new Payment( __SECRET_KEY__, __IV_KEY__, __ACCESS_CODE__, true );
The last parameter is a boolean which indicates on which environment are you on.
true
= Sandboxfalse
= Production
By default, the value will be
false
. -
Call the
checkout
method fromHesabe
by passing the request parameters in an array. It will redirect you to the Hesabe Payment Page.$hesabe->checkout([ "merchantCode" => __MERCHANT_CODE__, "amount" => "1", "paymentType" => "0", "responseUrl" => "http://yourlink.com", "failureUrl" => "http://yourlink.com", "orderReferenceNumber" => "", "variable1" => null, "variable2" => null, "variable3" => null, "variable4" => null, "variable5" => null, "version" => "2.0", ]);
These are the basic parameters which are passed to initiate a transaction, for more information about these parameters you may have a look here.
Credits
License
The MIT License (MIT). See the License File for more information.