PHPackages                             chargily/epay-php - 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. [API Development](/categories/api)
4. /
5. chargily/epay-php

AbandonedArchivedLibrary[API Development](/categories/api)

chargily/epay-php
=================

PHP Library for Chargily ePay Gateway integration

3.0.0(3y ago)283.2k—0%5[2 issues](https://github.com/Chargily/chargily-epay-php/issues)1MITPHPPHP ^8.0.2

Since Mar 28Pushed 2y ago4 watchersCompare

[ Source](https://github.com/Chargily/chargily-epay-php)[ Packagist](https://packagist.org/packages/chargily/epay-php)[ RSS](/packages/chargily-epay-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (1)

Chargily ePay Gateway PHP
=========================

[](#chargily-epay-gateway-php)

[![Chargily ePay Gateway](https://raw.githubusercontent.com/Chargily/epay-gateway-php/main/assets/banner-1544x500.png "Chargily ePay Gateway")](https://raw.githubusercontent.com/Chargily/epay-gateway-php/main/assets/banner-1544x500.png)

Integrate ePayment gateway with Chargily easily.

- Currently support payment by **CIB / EDAHABIA** cards and soon by **Visa / Mastercard**
- This is a **PHP package**, If you are using another programing language [Browse here](https://github.com/Chargily/) or look to [API documentation](https://github.com/Chargily/epay-gateway-php/blob/master/README_API.md)

Requirements
============

[](#requirements)

1. PHP 7.2.5 or later.
2. Get your API Key/Secret from [ePay by Chargily](https://epay.chargily.com) dashboard for free.

Installation
============

[](#installation)

1. Via Composer (Recomended)

```
composer require chargily/epay-php
```

2. Download as ZIP We do not recommend this option. But be careful to download the updated versions every a while [Download](https://github.com/Chargily/epay-gateway-php/releases/)

Quick start
===========

[](#quick-start)

1. create config file **epay\_config.php**This is where store your api credentials

```
//  Configurations file
return [
    'key' => 'your-api-key', // you can you found it on your epay.chargily.com.dz Dashboard
    'secret' => 'your-api-secret', // you can you found it on your epay.chargily.com.dz Dashboard
];
```

2. create payment redirection file **redirect.php**

```
use Chargily\ePay\Chargily;

require 'path-to-vendor/vendor/autoload.php';

$epay_config = require 'epay_config.php';

$chargily = new Chargily([
    //credentials
    'api_key' => $epay_config['key'],
    'api_secret' => $epay_config['secret'],
    //urls
    'urls' => [
        'back_url' => "valid-url-to-redirect-after-payment", // this is where client redirected after payment processing
        'webhook_url' => "valid-url-to-receive-payment-informations", // this is where you receive payment informations
    ],
    //mode
    'mode' => 'EDAHABIA', //OR CIB
    //payment details
    'payment' => [
        'number' => 'payment-number-from-your-side', // Payment or order number
        'client_name' => 'client name', // Client name
        'client_email' => 'client_email@mail.com', // This is where client receive payment receipt after confirmation
        'amount' => 75, //this the amount must be greater than or equal 75
        'discount' => 0, //this is discount percentage between 0 and 99
        'description' => 'payment-description', // this is the payment description

    ]
]);
// get redirect url
$redirectUrl = $chargily->getRedirectUrl();
//like : https://epay.chargily.com.dz/checkout/random_token_here
//
if($redirectUrl){
    //redirect
    header('Location: '.$redirectUrl);
}else{
    echo "We cant redirect to your payment now";
}
```

3. create payment processing file **process.php**

```
use Chargily\ePay\Chargily;

require 'path-to-vendor/vendor/autoload.php';

$epay_config = require 'epay_config.php';

$chargily = new Chargily([
    //credentials
    'api_key' => $epay_config['key'],
    'api_secret' => $epay_config['secret'],
]);

if ($chargily->checkResponse()) {
    $response = $chargily->getResponseDetails();
    //@ToDo: Validate order status by $response['invoice']['invoice_number']. If it is not already approved, approve it.
    //something else
    /*
        $response like the follwing array
            $response = array(
                "invoice" => array(
                            "id" => 5566321,
                            "client" => "Client name",
                            "invoice_number" => "123456789",
                            "due_date" => "2022-01-01 00:00:00",
                            "status" => "paid",
                            "amount" => 75,
                            "fee" => 25,
                            "discount" => 0,
                            "comment" => "Payment description",
                            "tos" => 1,
                            "mode" => "EDAHABIA",
                            "invoice_token" => "randoom_token_here",
                            "due_amount" => 10000,
                            "created_at" => "2022-01-01 06:10:38",
                            "updated_at" => "2022-01-01 06:13:00",
                            "back_url" => "https://www.mydomain.com/success",
                            "new" => 1,
                );
            )
    */
    exit('OK');
}
```

- Guide for testing your webhook (process) url [Click Here](https://github.com/Chargily/epay-gateway-php/blob/main/README_WEBHOOK.md)

Configurations
==============

[](#configurations)

- Available Configurations

keydescriptionredirect urlprocess urlapi\_keymust be string given by organizationrequiredrequiredapi\_secretmust be string given by organizationrequiredrequiredurlsmust be arrayrequirednot requiredurls\[back\_url\]must be string and valid urlrequirednot requiredurls\[process\_url\]must be string and valid urlrequirednot requiredmodemust be in **CIB**,**EDAHABIA**requirednot requiredpayment\[number\]must be string or intrequirednot requiredpayment\[client\_name\]must be stringrequirednot requiredpayment\[client\_email\]must be string and valid email This is where client receive payment receipt after confirmationrequirednot requiredpayment\[amount\]must be numeric and greather or equal than 75requirednot requiredpayment\[discount\]must be numeric and between 0 and 99.99 (discount percentage)requirednot requiredpayment\[description\]must be stringrequirednot requiredoptionsmust be arrayrequirednot requiredoptions\[headers\]must be arrayrequirednot requiredoptions\[timeout\]must be numericrequirednot requiredNotice
======

[](#notice)

- If you faced Issues [Click here to open one](https://github.com/Chargily/epay-gateway-php/issues/new)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68% 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 ~36 days

Total

4

Last Release

1401d ago

Major Versions

1.0.1 → 2.0.12022-05-04

2.0.2 → 3.0.02022-07-17

PHP version history (2 changes)1.0.1PHP &gt;=7.2.5

2.0.1PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f382cc16254c1c7e28478b6d70c95b3bbca1755a365ad516094e6f6d63679d0?d=identicon)[Chargily](/maintainers/Chargily)

---

Top Contributors

[![Medboubazine](https://avatars.githubusercontent.com/u/39988497?v=4)](https://github.com/Medboubazine "Medboubazine (17 commits)")[![ChargilyDev](https://avatars.githubusercontent.com/u/102842898?v=4)](https://github.com/ChargilyDev "ChargilyDev (5 commits)")[![LAGGOUNE-Walid](https://avatars.githubusercontent.com/u/16167585?v=4)](https://github.com/LAGGOUNE-Walid "LAGGOUNE-Walid (2 commits)")[![HichamZoubiri](https://avatars.githubusercontent.com/u/102681206?v=4)](https://github.com/HichamZoubiri "HichamZoubiri (1 commits)")

---

Tags

apichargilycibcibwebedahabiaepaygatewayintegrationlibrarypackagepaymentphpphp-composerphp-libraryphp-nativepluginsatimphpepaychargilyepaimentsatimcibcibwebepay.chargily.com.dzChargily-ePay-Gateway

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chargily-epay-php/health.svg)

```
[![Health](https://phpackages.com/badges/chargily-epay-php/health.svg)](https://phpackages.com/packages/chargily-epay-php)
```

###  Alternatives

[thehocinesaad/laravel-chargily-epay

Laravel-Chargily-ePay is a Laravel package that provides an easy interface to Chargily ePay gateway

202.1k](/packages/thehocinesaad-laravel-chargily-epay)[chargily/chargily-pay

PHP Library for Chargily Pay V2

135.2k1](/packages/chargily-chargily-pay)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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