PHPackages                             yosinan/chapavel - 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. [Framework](/categories/framework)
4. /
5. yosinan/chapavel

ActiveLibrary[Framework](/categories/framework)

yosinan/chapavel
================

Custom Chapa Payment Integration for Laravel

1.0.0(9mo ago)292PHPPHP ^8.1

Since Aug 14Pushed 9mo agoCompare

[ Source](https://github.com/Yosinan/chapavel)[ Packagist](https://packagist.org/packages/yosinan/chapavel)[ RSS](/packages/yosinan-chapavel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Chapavel
========

[](#chapavel)

A custom Laravel package for seamless integration with [Chapa](https://chapa.co/) payment gateway. Provides a clean API for initializing payments, verifying transactions, and handling secure webhooks.

---

Features
--------

[](#features)

- **Easy Payment Initialization**: Start payments with minimal code.
- **Webhook Verification**: Securely verify Chapa webhooks using HMAC SHA256.
- **Transaction Status**: Query and update payment status.
- **Idempotent Webhook Handling**: Prevents duplicate processing on retries.

---

Installation
------------

[](#installation)

1. **Require the package**:

    ```
    composer require yosinan/chapavel
    ```
2. **Publish the configuration file**:

    ```
    php artisan vendor:publish --tag=chapa-config
    ```
3. **Add your Chapa keys to `.env`**:

    ```
    CHAPA_SECRET_KEY=your_secret_key
    CHAPA_PUBLIC_KEY=your_public_key
    CHAPA_BASE_URL=https://api.chapa.co
    FRONTEND_URL=http://localhost:3000

    ```

---

Usage
-----

[](#usage)

### Initialize Payment

[](#initialize-payment)

```
use Yosinan\Chapavel\ChapaClient;

// Example: $payment is your payment model or array
$payload = [
    'amount'       => (string) $payment->amount,
    'currency'     => 'ETB',
    'email'        => $payment->email,
    'first_name'   => $payment->name,
    'tx_ref'       => $payment->tx_ref,
    'callback_url' => route('payment.return') . '?tx_ref=' . $payment->tx_ref,
    'return_url'   => route('payment.return') . '?tx_ref=' . $payment->tx_ref,
    'customization'=> [
        'title' => 'Order Payment',
        'description' => 'Checkout'
    ],
];

$chapa = new ChapaClient();
$response = $chapa->initialize($payload);
// $response['data']['checkout_url'] contains the payment URL
```

### Verify Payment

[](#verify-payment)

```
$response = $chapa->verify($txRef);
// $response contains transaction details
```

### Webhook Verification

[](#webhook-verification)

```
use Yosinan\Chapavel\WebhookVerifier;

$isValid = WebhookVerifier::isValid($rawBody, $sig1, $sig2, $secretKey);
if (!$isValid) {
    // Handle invalid signature
}
```

- Accepts both `Chapa-Signature` and `x-chapa-signature` headers.
- Uses HMAC SHA256 with your secret key.

---

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

Support
-------

[](#support)

For issues or feature requests, open an issue.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance58

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

270d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c161c5a028bbff4d595389fd34638da28501025641e06a7ea647fd04d218128?d=identicon)[Yosinan](/maintainers/Yosinan)

---

Tags

frameworklaravel

### Embed Badge

![Health badge](/badges/yosinan-chapavel/health.svg)

```
[![Health](https://phpackages.com/badges/yosinan-chapavel/health.svg)](https://phpackages.com/packages/yosinan-chapavel)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[graham-campbell/digitalocean

DigitalOcean Is A DigitalOcean Bridge For Laravel

509343.1k2](/packages/graham-campbell-digitalocean)[rahulalam31/laravel-abuse-ip

Block ip address of all spammer's around the world.

27431.5k](/packages/rahulalam31-laravel-abuse-ip)[graham-campbell/bitbucket

Bitbucket Is A Bitbucket Bridge For Laravel

75185.0k2](/packages/graham-campbell-bitbucket)

PHPackages © 2026

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