Search by

laranex / php-myanmar-payments

NayThuKhant

A framework-agnostic PHP SDK for Myanmar payment gateways with typed requests and results

Package info

github.com/laranex/php-myanmar-payments

Homepage

pkg:composer/laranex/php-myanmar-payments

Statistics

Installs: 765

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v4.0.0-alpha.4 2026-10-10 06:58 UTC

This package is auto-updated.

Last update: 2026-10-10 07:05:56 UTC


README

Framework-agnostic PHP SDK for Myanmar payment gateways: KBZ Pay (PWA, QR, In-App), Wave Money, AYA Payment Gateway, Yoma MMQR and CyberSource Secure Acceptance.

Each gateway takes a typed request object and returns a typed result, so your IDE shows exactly what to pass and what comes back.

Using Laravel? Install laranex/laravel-myanmar-payments, which wraps this package.

Documentation: laranex.vercel.app

composer require laranex/php-myanmar-payments

Requires PHP 8.1+ and any PSR-18 HTTP client (for example guzzlehttp/guzzle).

use Laranex\PhpMyanmarPayments\Http\CallbackRequest;
use Laranex\PhpMyanmarPayments\KbzPay\KbzPay;
use Laranex\PhpMyanmarPayments\KbzPay\KbzPayConfig;
use Laranex\PhpMyanmarPayments\KbzPay\KbzPayPaymentData;

$kbzPay = new KbzPay(new KbzPayConfig(appId: '...', appKey: '...', merchantCode: '...', sandbox: true));

// Start a payment: a typed result per flow
$payment = $kbzPay->pwa(new KbzPayPaymentData(orderId: 'ORDER_1', amount: 1000, callbackUrl: 'https://shop.test/kbz/callback'));
header('Location: '.$payment->url);

// Handle the callback: verified, with a gateway-independent status
$callback = $kbzPay->handleCallback(CallbackRequest::fromGlobals());

if ($callback->isSuccessful()) {
    // compare $callback->amount with your order, then fulfil $callback->orderId
}

$callback->acknowledgement()->send();