Download the PHP package blessdarah/php-campay without Composer

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

PHP Campay

This is a php wrapper for the campay API that enables a seemless integration of momo with PHP and Campay.

Requirements

This package works as from [email protected] and above. Ensure that you have the latest version of php installed.

How to install this package

To install this package, run:

Usage

The package automatically manages your tokens for all transactions with campay.

Configuration

This packages uses the dotenv package and thus if you're not using something like laravel which automatically loads env variables, you can set it up like this:

  1. Create a .env file in the root of your project if you don't already have one
  2. Copy your application username and password from your campay dashboard and add them like this:

  3. In your index.php file or your root application entry point, you have to load up the dotenv package

If you're not using composer, you can ignore the above steps and set up your .env vars using the php global $_ENV to setup your campay configurations in the location you want as follows:

Configure campay base url

Remark: You should make sure that you don't expose your config variables online as it will be a potential security issue for your application

Collect payment

Withdraw funds

For withdrawal, we use the withdraw function

The above response contains the info and the reference for your transaction that will enable you check its status using the getTransactionStatus function

Check transaction status

For checking transaction status after using the collect or the withdraw functions, you can pass the resulting reference key in order to check your transaction status

Get your application balance

Get transaction history with an interval

By default, your transaction history will return all your app's transactions for the past 7 days or past week

If you want the dates to be specific, you can pass your start and end dates like so:

Generate payment link

As per the campay documentation, you can generate a payment link or url that can be utilized for payments. Here's how you do it:


All versions of php-campay with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.0
nesbot/carbon Version ^3.5
vlucas/phpdotenv Version ^5.4
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 blessdarah/php-campay contains the following files

Loading the files please wait ...