PHPackages                             chargily/epay-symfony - 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-symfony

Abandoned → [chargily/epay-symfony](/?search=chargily%2Fepay-symfony)ArchivedSymfony-bundle[API Development](/categories/api)

chargily/epay-symfony
=====================

Chargily epay plugin for symfony.

v1.0.0(3y ago)201MITPHPPHP ^7.4 || ^8.0

Since Jul 27Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (21)Versions (2)Used By (0)

chargily-epay-symfony
=====================

[](#chargily-epay-symfony)

Symfony Plugin for Chargily ePay Gateway

[![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)

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

[](#installation)

1. Via Composer (Recomended)

```
composer require chargily/epay-symfony
```

2. Register the bundle, add this line at the end of the file config/bundles.php

```
\Chargily\SymfonyBundle\ChargilySymfonyBundle::class => ['all' => true],
```

3. Import the services, Add the follow line in config/services.yml

```
imports:
    - { resource: "@ChargilySymfonyBundle/config/services.yaml" }
```

4. Configure the api keys Add the follow line in config/services.yml

```
parameters:
    api_key: "API_KEY"
    secret_key: "SECRET_KEY"
```

5. Process payment and redirection to payment page

```
        $payload = array(
            "client" => "test",
            'client_email' => "test@gmail.com",
            "invoice_number" => '123456789',
            "amount" => 110,
            'discount' => 0,
            'mode' => 'CIB',
            'back_url' => "https://test.com",
            'webhook_url' => "https://test.com" . "/" . "webHookSuffixRoute". "/" ."OrderNumber",
            //back_url example when you want to take your host base url
            //'back_url'  => $request->getSchemeAndHttpHost(),
            //webhook_url example when you want to take your host base url and add your suffix route for the webhook
            //'webhook_url' => $request->getSchemeAndHttpHost() . "/" . you_back_url_suffix_here . "/" .Order_Number,
            'comment' => 'My Payment Comment.',
            'api_key' => $this->getParameter('api_key'),
        );

        $chargyliController = new ChargilyEpaySymfonyController();

        $response = $chargyliController->pay($payload);
        $status_code = $response->getStatusCode();
        $response = json_decode($response->getContent());
        if ($status_code == 200) {
            //redirect to chargily payment gateway
            return $this->redirect($response->response);
        } else {
            // This is a error message depending on issue that happen
            dd($status_code . " " . $response->response);
        }
```

6. success Message for the Process payment

```
200 => getting redirection link with success => Redirection to url
```

7. Error Message for the Process payment

```
400 => There mode must be CIB,EDAHABIA option Only
400 => There amount must be numeric and greather or equal than 75
400 => There is issue \for connecting payment gateway. Sorry \for the inconvenience => with error message
400 => There is missing information in payment parameters
```

8. Webhook Template

```
    /**
     * @Route("/chargily/webhook/{OrderNumber}",name="chargily_webhook")
     * @throws \Exception
     */
    public function chargilyWebhook(Request $request)
    {
        //getting your order number
        $number = $request->attributes->get('OrderNumber');

        //part or code for searching your order by number
        /*
         *
         */

        //getting request content
        $data = json_decode($request->getContent(), true);
        $headers = json_decode($request->headers, true);

        $hashedData =  hash_hmac('sha256', json_encode($data) , $this->getParameter('secret_key'));

        if (isset($data) and isset($number)) {
            if($data['invoice']['status'] == 'paid'){

                //part where you update your order status for paid status

                return new JsonResponse([
                    'code' => 200,
                    'message' => 'Update status with success'
                ]);
            }elseif($data['invoice']['status'] == 'failed'){
                //part where you update your order status for failed status

                return new JsonResponse([
                    'code' => 200,
                    'message' => 'Update status with success'
                ]);
            }
            elseif( $data['invoice']['status'] == 'canceled'){
                //part where you update your order status for canceled status
                return new JsonResponse([
                    'code' => 200,
                    'message' => 'Update status with success'
                ]);
            }
        } else {
            return new JsonResponse([
                'code' => 400,
                'message' => 'Update status Failed'
            ]);
        }

    }
```

9. Clear the Cache And Enjoy

```
php bin/console cache:clear
```

This Plugin is to integrate ePayment gateway with Chargily easily.

- Currently support payment by **CIB / EDAHABIA** cards and soon by **Visa / Mastercard**
- This repo is recently created for **Sylius Plugin**, If you are a developer and want to collaborate to the development of this plugin, you are welcomed!

Contribution tips
=================

[](#contribution-tips)

1. Make a fork of this repo.
2. Take a tour to our [API documentation here](https://dev.chargily.com/docs/#/epay_integration_via_api)
3. Get your API Key/Secret from [ePay by Chargily](https://epay.chargily.com.dz) dashboard for free.
4. Start developing.
5. Finished? Push and merge.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Unknown

Total

1

Last Release

1385d ago

### Community

Maintainers

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

---

Top Contributors

[![ChargilyDev](https://avatars.githubusercontent.com/u/102842898?v=4)](https://github.com/ChargilyDev "ChargilyDev (1 commits)")[![kiakahaDZ](https://avatars.githubusercontent.com/u/46278484?v=4)](https://github.com/kiakahaDZ "kiakahaDZ (1 commits)")

---

Tags

apichargilycibcibwebedahabiaepaygatewayintegrationlibrarypackagepaymentpluginsatimsymfony

###  Code Quality

TestsBehat

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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