camoo/camoo-pay

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

CamooPay plugin for mobile Money aggregation

1.0-beta 2021-08-14 12:56 UTC

This package is auto-updated.

Last update: 2021-10-16 03:46:58 UTC


README

Installation

You can install this plugin into your PHP application using composer.

The recommended way to install composer packages is:

composer require camoo/camoo-pay

Usage

use CamooPay\Exception\CamooPayCashoutException;
use CamooPay\Lib\CashOut;

$cashOut = new CashOut('token', 'secret', 'orange');
$phoneNumber = '690000000';
$amount = 850;
$customerEmail = 'end-customer@email.cm';
        try {
            $payment $cashOut->charge($phoneNumber, $amount, $customerEmail);

        } catch (CamooPayCashoutException $exception) {
            $message = $exception->getMessage();
            echo $message
        }
        
        var_dump($payment);

// Now verify the status
$transactionNumber = $payment['ptn'];
$checkPayment = new \CamooPay\Lib\CheckPayment('token', 'secret');
$verify = $checkPayment->check($transactionNumber);
var_dump($verify);