Download the PHP package chapa/chapa-laravel without Composer

On this page you can find all versions of the php package chapa/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 Logo

Official Laravel package for Chapa's API (Laravel 5,6,7,9,10,11)

If your are doing a Laravel project and want to integrate Chapa's payment solution, this package would help big time.

Go to Chapa to signup and get your secret key

Documentation

Please visit Chapa for full documentation.

Guide

Please visit Developers Guide for full guide and examples.

Usage

You can check this sample Laravel code as a reference.

Configuration

Open your .env file and add your public key, secret keys, and other environment variables like this:

Features

The current features have been implemented

API Reference

Create Subaccount

Parameter Type Required Description
business_name string Yes. The name of the business or vendor.
account_name string Yes. The name of the account holder, which must match the bank account details.
bank_code integer Yes. The ID of the bank where the subaccount is held. You can retrieve this from the "Get Banks" endpoint.
account_number string Yes. The bank account number for the subaccount
split_type string Yes. Defines how the payment will be split. Can be "percentage" or "flat".
split_value float Yes. The value of the split. If split_type is percentage, this represents a percentage (e.g., 0.03 for 3%).
If split_type is flat, this represents a fixed amount in ETB (e.g., 25 for 25 Birr).

Collecting Customer Information

Parameter Type Required Description
key string Yes. This will be your public key from Chapa. When on test mode use the test key, and when on live mode use the live key.
email string No. A customer’s email. address.
phone_number numeric No. A customer’s phone number. address.
amount string Yes. The amount you will be charging your customer.
first_name string No. A customer’s first name.
last_name string No. A customer’s last name.
tx_ref string Yes. A unique reference given to each transaction.
callback_url string No. Function that runs when payment is successful. This should ideally be a script that uses the verify endpoint on the Chapa API to check the status of the transaction.
return_url string No. A web address provided by the merchant to a payment gateway during payment integration. It serves as the destination where the payment gateway sends the customer after completing a payment transaction.
currency string Yes. The currency in which all the charges are made. Currency allowed is ETB.
customization[tiitle] string No. The customizations field (optional) allows you to customize the look and feel of the payment modal. You can set a logo, the store name to be displayed (title), and a description for the payment.
customization[description] string No. The customizations field (optional) allows you to customize the look and feel of the payment modal.
customization[subaccounts][id] string Yes. The customization field is optional. The subaccounts field within customization is also optional, but if provided, each subaccount must include an id (required). The payment will be split among the subaccounts based on the specified split_type and split_value.

Verify Payments

Parameter Type Required Description
key string Yes. This will be your public key from Chapa. When on test mode use the test key, and when on live mode use the live key.

Verify Transfers

Parameter Type Required Description
key string Yes. This will be your public key from Chapa. When on test mode use the test key, and when on live mode use the live key.

Bulk Transfers

Parameter Type Required Description
title string Yes. This will be your title or desciption for bulk transfer.
currency string Yes. The currency for the transfers (e.g., ETB for Ethiopian Birr).
bulk_data array Yes. An array of individual transfers containing the following fields:
bulk_data[].account_name string Yes. The name of the account holder for the transfer.
bulk_data[].account_number string Yes. The account number to which the transfer will be made.
bulk_data[].amount integer Yes. The amount to be transferred.
bulk_data[].reference string Yes. A unique reference for the individual transfer (used for tracking purposes).
bulk_data[].bank_code integer Yes. The bank code of the recipient's bank (get the code via Chapa’s banks API).

Get Banks

The Get Banks API retrieves a list of banks available for transfers via the Chapa API. This is useful when you need to display a list of banks for users to select from or when you need bank codes for initiating transactions.

Verify Webhooks

This function validates incoming webhook events from Chapa to ensure their authenticity. It checks the signature of the webhook against an expected signature, generated using the webhook payload and a secret key. If the signatures match, the webhook is considered valid.

Parameters:

Returns:

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of chapa-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0|^8.1
guzzlehttp/guzzle Version ~6|~7|~8|~9
illuminate/support Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0
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 chapa/chapa-laravel contains the following files

Loading the files please wait ....