dadandev / midtranspay
There is no license information available for the latest version (v1.0.0) of this package.
midtrans pay plugin for web
v1.0.0
2023-09-11 03:42 UTC
Requires
- php: >=8.1
README
Library midtrans tidak official yang di gunakan untuk berkomunikasi dengan api midtrans, library ini di khususkan untuk melakukan transaksi,mengecek transaksi
Cara Install
Composer Instalation
composer require dadandev/midtranspay
Cara Pake
<?php use DadanDev\MidtransPay\Configurasi; use DadanDev\MidtransPay\Environment; use DadanDev\MidtransPay\PayMent; include 'vendor/autoload.php'; $config = new Configurasi(Environment::DEVELOPMENT); $config->setServerKey('<your server key>'); $payment = new PayMent($config); $response = $payment->pay([ "payment_type" => "cstore", "transaction_details" => [ "order_id" => "INV-".strtoupper(uniqid()), "gross_amount" => 44000, ], "cstore" => [ 'store' => 'alfamart', ], 'customer_details' => [ 'first_name' => "Dadan Efendi", 'last_name' => "Indrayan", "email" => 'dadan@gmail.com', ] ]); var_dump($response);