/laravel-myanmar-payments

A Laravel Package to deal with Payment Packages from Myanmar

Primary LanguagePHPMIT LicenseMIT

Laravel Myanmar Payments

Latest Version on Packagist Total Downloads

A Laravel Package to deal with Payment Providers from Myanmar. This package can take care of PGW payments.

Supported Payments are as follows.

  • Wave Money
  • 2C2P

Workflows

  • Client App - Server Workflow

Client App - Server Workflow

  • Server Side only Workflow

Server Side only Workflow

Installation

You can install the package via composer:

composer require laranex/laravel-myanmar-payments

Configuration

  php artisan vendor:publish --tag="laravel-myanmar-payments"

Upgrade Guide

  • v1 -> v2
    • Backup & Delete the existing config/laravel-myanmar-payments.php (if only published before)
    • Publish the new config/laravel-myanmar-payments, and re-merge the old config/laravel-myanmar-payments.php
    • Update .env (KBZ Pay is supported now)

Wave Money Configuration 2c2P Configuration KBZ Pay Configuration

Usage

use Laranex\LaravelMyanmarPayments\LaravelMyanmarPaymentsFacade;


# WAVEMONEY
# Payment Screen
LaravelMyanmarPaymentsFacade::channel('wave_money')
    ->getPaymentScreenUrl($items, $orderId, $amount, $merchantReferenceId, $backendResultUrl, $frontendResultUrl, $paymentDescription)
# Validate Response Signature
Laranex\LaravelMyanmarPayments\LaravelMyanmarPaymentsFacade::channel("wave_money")
    ->verifyWaveSignature($request)


# 2C2P
# Payment Screen
LaravelMyanmarPaymentsFacade::channel('2c2p')
    ->getPaymentScreenUrl($orderId, $amount, $noneStr, $backendResultUrl,$currencyCode, $frontendResultUrl, $paymentDescription, $userDefined)
# Parse Response Payload
Laranex\LaravelMyanmarPayments\LaravelMyanmarPaymentsFacade::channel('2c2p')
->parseJWT('jwtTokenFrom2c2cServer', $currencyCode)
# $frontendResultUrl & $paymentDescription are optional and the rest are mandatory.


#KBZ PAY
# PWA URL
LaravelMyanmarPaymentsFacade::channel("kbz_pay.pwaapp")
    ->getPaymentScreenUrl($orderId, $amount, $nonceStr,  $backendResultUrl)
# QR Code
LaravelMyanmarPaymentsFacade::channel("kbz_pay.qr")
    ->getPaymentScreenUrl($orderId, $amount, $nonceStr,  $backendResultUrl)

# In App
LaravelMyanmarPaymentsFacade::channel("kbz_pay.app")->getPaymentData($orderId, $amount, $nonceStr, $backendResultUrl);

# $nonceStr should be at least 32 characters long, uppercase & numbers according to KbzPay Documentation

# Validate Response Signature
LaravelMyanmarPaymentsFacade::channel("kbz_pay.qr")
    verifySignature($request)

For more api options, you can read the composition of the

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email naythukhant644@gmail.com instead of using the issue tracker.

Contributors

License

The MIT License (MIT). Please see License File for more information.