PHPackages                             vp-trading/chapa-laravel - 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. vp-trading/chapa-laravel

ActiveLibrary

vp-trading/chapa-laravel
========================

1.3.0(1mo ago)1580↓100%MITPHPPHP ~8.2 || ^8.3CI passing

Since Aug 28Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/VP-Trading/chapa-laravel)[ Packagist](https://packagist.org/packages/vp-trading/chapa-laravel)[ RSS](/packages/vp-trading-chapa-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (16)Used By (0)

Chapa Laravel Package
=====================

[](#chapa-laravel-package)

[![Total Downloads](https://camo.githubusercontent.com/d7539cdf2cf535a68eaf2c7a5c6a45fde93ad3568ed1a85af4c4dde7ca07f48d/68747470733a2f2f706f7365722e707567782e6f72672f76702d74726164696e672f63686170612d6c61726176656c2f642f746f74616c2e737667)](https://packagist.org/packages/vp-trading/chapa-laravel)[![Latest Stable Version](https://camo.githubusercontent.com/21ec9eb67a2fb9ff3058cdc9375a21063acee3c138e02c81147f274bfc0aacd7/68747470733a2f2f706f7365722e707567782e6f72672f76702d74726164696e672f63686170612d6c61726176656c2f762f737461626c652e737667)](https://packagist.org/packages/vp-trading/chapa-laravel)[![License](https://camo.githubusercontent.com/b7d29a2a8786b96db8d091e43d66be8b3c4773c4763f8c09c1c662df732db942/68747470733a2f2f706f7365722e707567782e6f72672f76702d74726164696e672f63686170612d6c61726176656c2f6c6963656e73652e737667)](https://packagist.org/packages/vp-trading/chapa-laravel)

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

[](#installation)

To install the `chapa-laravel` package, follow these steps:

1. **Require the package via Composer:**

    ```
    composer require vp-trading/chapa-laravel
    ```
2. **Publish the configuration, route, and migration files:**

    ```
    php artisan vendor:publish --provider="Vptrading\ChapaLaravel\ChapaServiceProvider"
    ```

    The package comes with config, route, and migration files to help you get started quickly.
3. **Run the migration:**

    ```
    php artisan migrate
    ```
4. **Configure your `.env` file:**Add your Chapa API keys:

    ```
    CHAPA_SECRET_KEY=your_chapa_secret_key_here
    CHAPA_CALLBACK_URL=/vp/chapa/webhook
    CHAPA_WEBHOOK_SECRET=54LZzhZbPs7yreuS6bAw74zS0KE7P4Mt1fiqRx7wOL8OdjUQHjBqsIpkpT2rm43S
    CHAPA_REF_PREFIX=vp_chapa_
    ```
5. **Ready to use!**You can now use the package in your Laravel application.

Usage
-----

[](#usage)

> Before you start using this package you should know all amount must be put in ***cent values***. The development of this package took standards from stripe. So for example if you want the amount be 100 Birr you will put 10000.

Here are some basic usage examples:

### Initialize Payment

[](#initialize-payment)

```
use Vptrading\ChapaLaravel\Facades\Chapa;
use VpTrading\ChapaLaravel\ValueObjects\User;
use VpTrading\ChapaLaravel\ValueObjects\Customization;
use Money\Money;

$response = Chapa::acceptPayment([
    Money::ETB(10000),
    new User(
        firstName: 'John',
        lastName: 'Doe',
        email: 'johndoe@example.com',
        phoneNumber: '0912345678'
    ),
    route('return-url'),
    new Customization(
        title: 'VP Solutions',
        description: 'This package is working like a charm.',
        logo: 'https://vptrading.et/wp-content/uploads/2023/08/cropped-VP-Logo-Symbol-White.png'
    )
]);

// Redirect user to payment page
return redirect($response->checkout_url);
```

The Customization in the acceptPayment() method is **optional** and can be left out.

### Verify Payment

[](#verify-payment)

```
use Vptrading\ChapaLaravel\Facades\Chapa;

$tx_ref = 'unique-tx-ref-123';
$verification = Chapa::verify($tx_ref);

if ($verification->data['status'] === 'success') {
    // Payment was successful
}
```

### Refund

[](#refund)

```
use Vptrading\ChapaLaravel\Facades\Chapa;
use Money\Money;

$chapaRef = "APfxLoHHsl1eD";
Chapa::refund($chapaRef, Money::ETB(10000), 'Client Requested Refund');
```

The amount and reason in the refund method are **optional** and can be left null.

### Webhook

[](#webhook)

Chapa sends webhooks for all payment-related events to your application. This package provides a default webhook controller to handle these events. You can extend or override the default controller `Vptrading\ChapaLaravel\Http\Controllers\WebhookController::class` to implement custom logic for different webhook events.

To customize webhook handling, create your own controller and update the route in your application as needed.

Default route for receiving webhook is: `/vp/chapa/webhook`

You can change the route by changing the `CHAPA_CALLBACK_URL` env variable.

```
class WebhookController extends ChapaWebhookController
{
    public function __invoke(Request $request)
    {
        parent::__invoke($request);

        // Handle your custom logic here.
    }
}
```

***🚀 And that's it. Do your thing and Give us a star if this helped you.🚀***

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance89

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~16 days

Recently: every ~51 days

Total

14

Last Release

53d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.3.0PHP ~8.2 || ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/1214089c541d816fb8e652c04039c17ee78639ddef4b2d1582c5a1b49d157105?d=identicon)[vptrading](/maintainers/vptrading)

---

Top Contributors

[![alazark94](https://avatars.githubusercontent.com/u/35865798?v=4)](https://github.com/alazark94 "alazark94 (66 commits)")

---

Tags

phplaravelchapavpVPTrading

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/vp-trading-chapa-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/vp-trading-chapa-laravel/health.svg)](https://phpackages.com/packages/vp-trading-chapa-laravel)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)

PHPackages © 2026

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