Download the PHP package vp-trading/chapa-laravel without Composer

On this page you can find all versions of the php package vp-trading/chapa-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chapa-laravel

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:

  2. Publish the configuration, route, and migration files:

    The package comes with config, route, and migration files to help you get started quickly.

  3. Run the migration:

  4. Configure your .env file: Add your Chapa API keys:

  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

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:

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:

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

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.

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


All versions of chapa-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2 || ^8.3
illuminate/http Version ^11.0 || ^12.0 || ^13.0
moneyphp/money Version ^4.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vp-trading/chapa-laravel contains the following files

Loading the files please wait ...