Midtrans :heart: CodeIgniter 4!
Veritrans now is Midtrans
This is the all new Codeigniter client library for Veritrans 2.0. Visit https://www.midtrans.com for more information about the product and see documentation at http://docs.midtrans.com for more technical details.
SNAP! for technical info Visit https://snap-docs.midtrans.com
The following plugin is tested under following environment:
composer require codenom/midtrans
(Recommended).After installation Module, please follow instruction:
php spark codenom:midtrans publish
.public $isProduction = TRUE (Production) or FALSE (Sandbox)
on Midtrans.php.//load services Midtrans
$services = new Config\Services::Midtrans();
OR
//load services Midtrans
$services = new services('Midtrans');
/**
* @param array $placeOrder
* @return object response CURL
*/
$services->getSnapToken(array $placeOrder = []);
//load services Veritrans
$services = new Config\Services::veritrans();
OR
//load services Veritrans
$services = new services('Veritrans');
Get Status transaction
/**
* @param string $id
*
* @return object response CURL
*/
$services->getStatus($id);
Appove challenge transaction
/**
* @param $id ID transactions
* @return status code from Midtrans
*/
$services->approve($id);
Cancel transaction before it's setteled
/**
* @param string $id Order ID or transaction ID
* @return string
*/
$services->cancel($id);
Expire transaction before it's setteled
/**
* @param string $id Order ID or transaction ID
* @return mixed[]
*/
$services->expire($id);
For more COMINGSOON
You can visit the following repository: Midtrans Sample Data