flabib/ipaymu

iPaymu-PHP API Package Library

1.0.8 2020-01-27 17:12 UTC

This package is auto-updated.

Last update: 2024-05-28 03:49:51 UTC


README

The easiest way to integrate your website into iPaymu payment gateway.

Build Status Latest Stable Version Total Downloads Latest Unstable Version License StyleCI

Installation

The best way to use this package is using composer

composer require flabib/ipaymu

Usage

Initialization

<?php
use Flabib\iPaymu\iPaymu;

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

Set URL

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

Set Buyer

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

Check API Key Validity

$iPaymu->isApiKeyValid();

Check Balance

$iPaymu->checkBalance();

Add Product to Cart

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

Pay Cstore

Please add product to cart first before using this method

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

Pay VA

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

Pay Bank

$cart = $iPaymu->payBank();

Check Transaction Status

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

Authors

See also the list of contributors who participated in this project.