hak/payments-mpu

Myanmar Payment Union And 2C2P One Stop Payment Integration Packages

v1.0 2023-09-09 15:16 UTC

This package is auto-updated.

Last update: 2024-04-11 15:09:58 UTC


README

Test Suite

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