New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

vp-trading/chapa-laravel

1,017 1

Larablocks Analysis

vp-trading/chapa-laravel works with Laravel 11, 12 and 13 (latest release 1.4.3, Sep 23, 2026).

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Sep 23, 2026)
  • 80 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Actively maintained
  • Last stable release: Sep 23, 2026.
  • 5 releases in the last 12 months.
  • First released: Aug 28, 2025.
  • Monthly downloads: 80.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require vp-trading/chapa-laravel
Latest Version:1.4.3
PHP:~8.2 || ^8.3
Laravel:11 · 12 · 13
License:MIT
Last Updated:Sep 23, 2026
Links: GitHub  ·  Packagist
Maintainer: vptrading

Chapa Laravel Package

Total Downloads Latest Stable Version License

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_API_VERSION=v1
    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

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

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.

Chapa API v2

API v1 remains the default so existing applications continue to work without changes. To opt in to API v2, add:

CHAPA_API_VERSION=v2

The v2 API uses https://api.chapa.global/v2 by default. You can override it with CHAPA_V2_BASE_URL when needed.

The existing acceptPayment(), verifyPayment(), and refund() PHP interfaces remain unchanged. Under v2:

  • Hosted payments use the nested customer payload and a generated merchant_reference.
  • AcceptPaymentResponse::$transaction_id continues to contain that generated merchant reference.
  • verifyPayment() expects the Chapa payment reference returned by Chapa through verification or a webhook.
  • refund() expects the successful payment's Chapa reference.
  • The legacy returnUrl and Customization arguments are retained for source compatibility but are not sent by the v2 hosted-payment API. Configure redirect and checkout presentation using the options supported by your Chapa v2 dashboard.

During migration, the included webhook endpoint accepts both v1 and v2 payload formats. When CHAPA_WEBHOOK_SECRET is configured, both formats require a valid x-chapa-signature generated from the exact raw request body.

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

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

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.🚀

Related Packages

valorin/random

Random is a simple helper package designed to make it easy to generate a range o...

479,812 234
php
cline/variable-keys

Laravel Blueprint macros for variable primary key and morph types

26,787 0
php
cline/struct

Lean, attribute-driven Laravel data objects with explicit validation and Eloquen...

22,365 0
php
cline/toggl

Advanced feature flag management with strategies, time bombs, and groups

15,405 0
php
cline/sequencer

Sequential migration and operation orchestration for Laravel

14,448 0
php

Version History

Version Released PHP Laravel License
1.4.3 ~8.2 || ^8.3 ^11.0 || ^12.0 || ^13.0 MIT
1.4.2 ~8.2 || ^8.3 ^11.0 || ^12.0 || ^13.0 MIT
1.4.1 ~8.2 || ^8.3 ^11.0 || ^12.0 || ^13.0 MIT
1.4.0 ~8.2 || ^8.3 ^11.0 || ^12.0 || ^13.0 MIT
1.3.0 ~8.2 || ^8.3 ^11.0 || ^12.0 || ^13.0 MIT