PHP code example of camoo / camoo-pay
1. Go to this page and download the library: Download camoo/camoo-pay library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
camoo / camoo-pay example snippets
use CamooPay\Exception\CamooPayCashoutException;
use CamooPay\Lib\CashOut;
$cashOut = new CashOut('token', 'secret', 'orange');
$phoneNumber = '690000000';
$amount = 850;
$customerEmail = '[email protected]';
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);