hak / payments-mpu
Myanmar Payment Union And 2C2P One Stop Payment Integration Packages
v1.0
2023-09-09 15:16 UTC
Requires
- php: ^8.0
- firebase/php-jwt: ^6.8
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- orchestra/testbench: ^8.10
- pestphp/pest: ^2.16
- pestphp/pest-plugin-laravel: ^2.2
This package is auto-updated.
Last update: 2024-04-11 15:09:58 UTC
README
Installation
composer require hak/payments-mpu
Usage
use Hak\Payments\PaymentGateway; public function store(Request $request) { // Request for paymentToken and Redirect Url $gateway = new PaymentGateway( 'JT02', '72B8F060B3B923E580411200068A764610F61034AE729AB9EF20CAFF93AFA1B9', true ); $payment = $gateway->create([ 'currencyCode' => 'MMK', 'amount' => 1000, 'invoiceNo' => random_int(11111111, 99999999), 'description' => 'test payment description', 'frontendReturnUrl' => 'https://example.com/frontend-return-url' ]); // that will return an instance of TokenResponse // Redirect Url $redirect_url = $payment->url; // status $status = $payment->status; // message $message = $payment->message; // Payment token $token = $payment->token; }
public function update(Request $request) { $inquiry = $gateway->inquiry([ 'invoiceNo' => '000024252314' ]); // that will return array of payment inquiry details return $inquiry->getInquiry(); }
You can get config variables from developer.2c2p.com
- MERCHANT_ID // JT02
- SECRET_KEY // SHA256 key
- frontendReturnUrl // https://example.com/fronend-result-url
- backendReturnUrl // https://example.com/backend-result-url