PHP code example of flabib / ipaymu

1. Go to this page and download the library: Download flabib/ipaymu 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/ */

    

flabib / ipaymu example snippets



use Flabib\iPaymu\iPaymu;

$production = true; // Set to false for sandbox
$iPaymu = new iPaymu('your-api-key', $production);

$iPaymu->setURL([
    'ureturn' => 'https://your-website',
    'unotify' => 'https://your-website',
    'ucancel' => 'https://your-website',
]);


$iPaymu->setBuyer([
    'name' => 'your-name',
    'phone' => 'your-phone',
    'email' => 'your-email',
]);

$iPaymu->isApiKeyValid();

$iPaymu->checkBalance();

$cart = $iPaymu->addCart([
    'name' => 'product-name',
    'quantity' => 'product-quantity',
    'price' => 'product-price',
]);

$cart = $iPaymu->payCstore('indomaret/alfamart');

$cart = $iPaymu->payVA('cn/bni/bag/mandiri');

$cart = $iPaymu->payBank();

$iPaymu->checkTransaction("transaction-id");