hesabe/payment

Hesabe Payment Package allows you to use the Payment API to accept payments in Kuwait

v1.0.3 2020-11-09 11:53 UTC

This package is auto-updated.

Last update: 2024-05-09 20:05:07 UTC


README

Latest Stable Version License Total Downloads Fahad Khan

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

  1. Minimum PHP 7.0+ required
  2. Composer installed globally

Installation

  1. Run the following command in the root of your PHP project:

    composer require hesabe/payment
    
  2. Import the Payment class in the file you want to use this package.

    use Hesabe\Payment\Payment; 
    
  3. Initialise the Hesabe instance using Payment 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 = Sandbox
    • false = Production

    By default, the value will be false.

  4. Call the checkout method from Hesabe 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.