QPay V2 payment integration for Laravel.
composer require qpay-sdk/laravel
php artisan qpay:installAdd to .env:
QPAY_BASE_URL=https://merchant.qpay.mn
QPAY_USERNAME=your_username
QPAY_PASSWORD=your_password
QPAY_INVOICE_CODE=your_invoice_code
QPAY_CALLBACK_URL=https://yoursite.com/qpay/webhook
use QPay\Laravel\Facades\QPay;
use QPay\Models\CreateSimpleInvoiceRequest;
$invoice = QPay::createSimpleInvoice(new CreateSimpleInvoiceRequest(
invoiceCode: config('qpay.invoice_code'),
senderInvoiceNo: 'ORDER-001',
amount: 10000,
callbackUrl: config('qpay.callback_url'),
));
// $invoice->invoiceId, $invoice->qrImage, $invoice->urls<x-qpay-qr-code :qr-image="$invoice->qrImage" />
<x-qpay-payment-button :urls="$invoice->urls" :short-url="$invoice->qPayShortUrl" />Listen for payment events:
use QPay\Laravel\Events\PaymentReceived;
Event::listen(PaymentReceived::class, function ($event) {
// $event->paymentId
// $event->result->rows
});MIT