Skip to content

hakhant21/payments-mpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2C2P Myanmar One Stop Payment Service Integration Package

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages