PHPackages                             clickpaysa/laravel\_package - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. clickpaysa/laravel\_package

ActiveComposer-package

clickpaysa/laravel\_package
===========================

Official laravel package to implement ClickPay integration with laravel apps

1.4.0(2y ago)17.2k↓36.5%3[3 issues](https://github.com/clickpaysa/laravel-package/issues)[2 PRs](https://github.com/clickpaysa/laravel-package/pulls)MITPHPPHP ^7.0|^8.0

Since Dec 8Pushed 2y agoCompare

[ Source](https://github.com/clickpaysa/laravel-package)[ Packagist](https://packagist.org/packages/clickpaysa/laravel_package)[ Docs](https://clickpay.com.sa)[ RSS](/packages/clickpaysa-laravel-package/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

Laravel ClickPay

Description
-----------

[](#description)

This Package provides integration with the ClickPay payment gateway.

CONTENTS OF THIS FILE
---------------------

[](#contents-of-this-file)

- Introduction
- Requirements
- Installation
- Configuration
- usage

INTRODUCTION
------------

[](#introduction)

This Package integrates ClickPay online payments into the Laravel Framework starts from version 5.8 - 8.x.

REQUIREMENTS
------------

[](#requirements)

This Package requires no external dependencies.

INSTALLATION
------------

[](#installation)

- composer require clickpaysa/laravel\_package

CONFIGURATION
-------------

[](#configuration)

- composer dump-autoload
- Go to *config/app.php* and in the providers array add

    ```
      Clickpaysa\Laravel_package\PaypageServiceProvider::class,

    ```
- Create the package config file:

    ```
      php artisan vendor:publish --tag=clickpay

    ```
- Go to *config/logging.php* and in the channels array add

    ```
    'ClickPay' => [
    'driver' => 'single',
    'path' => storage_path('logs/clickpay.log'),
    'level' => 'info',
    ],

    ```
- In *config/clickpay.php* add your merchant info.

**Important Hint:**you can pass your merchant info in the environment file with the same key names mentioned in the *config/clickpay.php* file. This value will be returned if no environment variable exists for the given key.

Usage
-----

[](#usage)

- create pay page

    ```
      use Clickpaysa\Laravel_package\Facades\paypage;

      $pay= paypage::sendPaymentCode('all')
             ->sendTransaction('sale')
              ->sendCart(10,1000,'test')
             ->sendCustomerDetails('Name', 'email@email.com', '0501111111', 'test', 'Riyadh', 'Riyadh', 'SA', '1234','10.0.0.10')
             ->sendShippingDetails('Name', 'email@email.com', '0501111111', 'test', 'Riyadh', 'Riyadh', 'SA', '1234','10.0.0.10')
             ->sendURLs('return_url', 'callback_url')
             ->sendLanguage('en')
             ->create_pay_page();
      return $pay;

    ```
- if you want to pass the shipping address as same as billing address you can use

    ```
      ->sendShippingDetails('same as billing')

    ```
- if you want to hide the shipping address you can use

    ```
      ->sendHideShipping(true);

    ```
- if you want to use iframe option instead of redirection you can use

    ```
      ->sendFramed(true);

    ```
- if you want to pass the payment methods you can use

    ```
      ::sendPaymentCode("['creditcard','mada']")

    ```
- if you want to pass the Tokenization option you can use

    ```
      ->sendTokinse(true)

    ```
- if you want to make a payment via token you can use

    ```
      ->sendTransaction('transaction_type','recurring')
      ->sendToken('token returned from the first payment page created with Tokenization option','transRef returned to you in the same first payment page')

    ```
- if you want to make a payment with user defined you can use

    ```
      ->sendUserDefined(["udf1"=>"UDF1 Test", "udf2"=>"UDF2 Test", "udf3"=>"UDF3 Test"])

    ```
- refund (you can use this function to both refund and partially refund)

    ```
      $refund = Paypage::refund('tran_ref','order_id','amount','refund_reason');
      return $refund;

    ```
- Auth

    ```
      pay= Paypage::sendPaymentCode('all')
             ->sendTransaction('Auth')
              ->sendCart(10,1000,'test')
             ->sendCustomerDetails('Name', 'email@email.com', '0501111111', 'test', 'Riyadh', 'Riyadh', 'SA', '1234','10.0.0.10')
             ->sendShippingDetails('Name', 'email@email.com', '0501111111', 'test', 'Riyadh', 'Riyadh', 'SA', '1234','10.0.0.10')
             ->sendURLs('return_url', 'callback_url')
             ->sendLanguage('en')
             ->create_pay_page();
      return $pay;

    ```
- capture (the tran\_ref is the tran\_ref of the Auth transaction you need to capture it.

    you can use this function to both capture and partially capture.)

    ```
       $capture = Paypage::capture('tran_ref','order_id','amount','capture description');
       return $capture;

    ```
- void (the tran\_ref is the tran\_ref of the Auth transaction you need to void it.

    you can use this function to both capture and partially capture)

    ```
      $void = Paypage::void('tran_ref','order_id','amount','void description');
      return $void

    ```
- transaction details

    ```
      $transaction = Paypage::queryTransaction('tran_ref');
      return $transaction;

    ```
- if you face any error you will find it logged in: *storage/logs/clickpay.log*

PAYMENT RESULT NOTIFICATION
---------------------------

[](#payment-result-notification)

ClickPay payment gateway provides means to notify your system with payment result once transaction processing was completed so that your system can update the transaction respective cart.

To get use of this feature do the following:

1- Defining a route (Optional)
------------------------------

[](#1--defining-a-route-optional)

Laravel ClickPay package comes with a default route for incoming IPN requests. The route URI is */paymentIPN* , if you don't like it this URI just ignore it and define your own. Look at *routes/routes.php* to get a clue.

2- Implementing a means to receive notification
-----------------------------------------------

[](#2--implementing-a-means-to-receive-notification)

To receive notification, do one of the following:

- While creating a pay page, passed this route as a Callback URL to *sendURLs* method, that URL will receive an HTTP Post request with the payment result. For more about callback check: **merchant dashboard** &gt; **Developers** &gt; **Transaction API**.
- Second means is to configure IPN notification from merchant dashboard. For more details about how to configure IPN request and its different formats check: **merchant dashboard** &gt; **Developers** &gt; **Service Types**.

3- Configuring a callback method
--------------------------------

[](#3--configuring-a-callback-method)

Now, you need to configure the plugin with the class\\method that will grab the payment details and perform your custom logic (updating cart in DB, notifying the customer ...etc ).

- In your website *config/clickpay.php* file, add the following:

    ```
      'callback' => env('clickpay_ipn_callback', namespace\your_class::class ),

    ```
- In your class add new method, it must named: **updateCartByIPN**

    ```
      updateCartByIPN( $requestData){
          $cartId= $requestData->getCartId();
          $status= $requestData->getStatus();
          //your logic .. updating cart in DB, notifying the customer ...etc
      }

    ```

you can also get transaction reference number. To get the list of available properties check: *Clickpaysa\\Laravel\_\_clickpay\\IpnRequest* class.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~64 days

Total

5

Last Release

1001d ago

Major Versions

0.4.0 → 1.1.02023-08-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/a857178b7c777ed58241c935f57f809edb68c47e646b680a8b061a863d8e2a91?d=identicon)[clickpay](/maintainers/clickpay)

![](https://www.gravatar.com/avatar/1c42cbdc2e5f81a4d0f567351982ad3d3a39771335c74025041c775de25cae06?d=identicon)[Riyaztechsupport](/maintainers/Riyaztechsupport)

---

Top Contributors

[![asabra-clickpay](https://avatars.githubusercontent.com/u/103630680?v=4)](https://github.com/asabra-clickpay "asabra-clickpay (13 commits)")[![Riyaztechsupport](https://avatars.githubusercontent.com/u/135695828?v=4)](https://github.com/Riyaztechsupport "Riyaztechsupport (2 commits)")

---

Tags

laravelpaymentsE-comerceClickPay

### Embed Badge

![Health badge](/badges/clickpaysa-laravel-package/health.svg)

```
[![Health](https://phpackages.com/badges/clickpaysa-laravel-package/health.svg)](https://phpackages.com/packages/clickpaysa-laravel-package)
```

###  Alternatives

[paytabscom/laravel_paytabs

Official laravel package to implement PayTabs integration with laravel apps

24171.9k6](/packages/paytabscom-laravel-paytabs)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[a17mad/laravel-cybersource

This package wraps the Cybersource SOAP API in a convenient, easy to use package for Laravel.

136.8k](/packages/a17mad-laravel-cybersource)[itsmurumba/laravel-mpesa

Laravel Package for Mpesa Daraja API

191.6k](/packages/itsmurumba-laravel-mpesa)[threesquared/laravel-paymill

Laravel wrapper for the Paymill API

121.3k](/packages/threesquared-laravel-paymill)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
