2017 © Pedro Peláez
 

library ipay

iPay Africa PHP package for transaction handling

image

smodav/ipay

iPay Africa PHP package for transaction handling

  • Friday, June 23, 2017
  • by SmoDav
  • Repository
  • 1 Watchers
  • 2 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 88 % Grown

The README.md

iPay Africa Web Based Integration API

Build Status Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

This is a PHP package for iPay Africa Web based integration. The API allows a merchant to initiate C2B transaction and receive payments from the customers., (*2)

Installation

Pull in the package through Composer., (*3)

composer require smodav/ipay

Usage

To make a request is simple. Just initiate the Cashier and finalize the transaction:, (*4)

use SmoDav\iPay\Cashier;

require "vendor/autoload.php";

$cashier = new Cashier();

$response = $cashier
    ->usingVendorId('your vendor id', 'your vendor secret')
    ->withCallback('http://yourcallback.com')
    ->withCustomer('0722000000', 'demo@example.com', false)
    ->transact(10, 'your order id', 'your order secret');

The $response variable will hold the html response from iPay. Just render it to the page and the process would be complete., (*5)

Payment Channels

By default, you are able to transact with multiple channels. The package default are: - MPesa - Airtel Money - Equity - Credit Card - Debit Card, (*6)

In order to use other channels, you can call the usingChannels() method with a channel array. The currently available channels are: - Cashier::CHANNEL_MPESA - Cashier::CHANNEL_AIRTEL - Cashier::CHANNEL_EQUITY - Cashier::CHANNEL_MOBILE_BANKING - Cashier::CHANNEL_DEBIT_CARD - Cashier::CHANNEL_CREDIT_CARD - Cashier::CHANNEL_MKOPO_RAHISI - Cashier::CHANNEL_SAIDA, (*7)

For example:, (*8)

use SmoDav\iPay\Cashier;

require "vendor/autoload.php";

$cashier = new Cashier();

$transactChannels = [
    Cashier::CHANNEL_MPESA,
    Cashier::CHANNEL_AIRTEL,
];

$response = $cashier
    ->usingChannels($transactChannels)
    ->usingVendorId('your vendor id', 'your vendor secret')
    ->withCallback('http://yourcallback.com')
    ->withCustomer('0722000000', 'demo@example.com', false)
    ->transact(10, 'your order id', 'your order secret');

Disclaimer

The iPay API has a bug of displaying channels that have not been enabled and vice versa., (*9)

License

The M-Pesa Package is open-sourced software licensed under the MIT license., (*10)

The Versions

23/06 2017

1.0.x-dev

1.0.9999999.9999999-dev

iPay Africa PHP package for transaction handling

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar SmoDav

laravel api transactions credit card mpesa ipay airtel money

23/06 2017

dev-master

9999999-dev

iPay Africa PHP package for transaction handling

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar SmoDav

laravel api transactions credit card mpesa ipay airtel money

23/06 2017

v1.1.0

1.1.0.0

iPay Africa PHP package for transaction handling

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar SmoDav

laravel api transactions credit card mpesa ipay airtel money

23/06 2017

v1.0.0

1.0.0.0

iPay Africa PHP package for transaction handling

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar SmoDav

laravel api transactions credit card mpesa ipay airtel money