qpay-sdk/laravel
最新稳定版本:1.0.0
Composer 安装命令:
composer require qpay-sdk/laravel
包简介
QPay V2 payment integration for Laravel
README 文档
README
QPay V2 payment integration for Laravel.
Install
composer require qpay-sdk/laravel php artisan qpay:install
Configuration
Add 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
Usage
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
Blade Components
<x-qpay-qr-code :qr-image="$invoice->qrImage" /> <x-qpay-payment-button :urls="$invoice->urls" :short-url="$invoice->qPayShortUrl" />
Webhook
Listen for payment events:
use QPay\Laravel\Events\PaymentReceived; Event::listen(PaymentReceived::class, function ($event) { // $event->paymentId // $event->result->rows });
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-26