krugerdavid/laravel-bancard-qr
Composer 安装命令:
composer require krugerdavid/laravel-bancard-qr
包简介
Laravel wrapper package for the Bancard QR API
README 文档
README
Laravel wrapper package for Bancard QR API. More information about Bancard QR here
What's new in v2.0
- Manager + Facade: Inyectable
BancardQRManagery Facade para mejor testabilidad - Dependency injection: Soporte nativo para inyección de dependencias
- Config mejorada:
mergeConfigFrom— la config funciona sin publicar; timeout configurable - Manejo de errores: Excepciones en lugar de retornar JSON; logging con
Log::error - Tests: Suite completa con Pest (Unit + Feature)
- CI: GitHub Actions para PHP 8.2–8.4 y Laravel 11–12
- Bugs corregidos:
revert()usaba keys de config incorrectos;formatExceptionfallaba sin response
Requirements
- PHP 8.1 or later
- Laravel 10, 11 or later
Installation
Fire up Composer and require this package in your project.
composer require krugerdavid/laravel-bancard-qr
That's it.
Publish the config
Run the following command to publish config file,
php artisan vendor:publish --tag=bancardqr-config
Add ENV keys
Add the following keys on your .env file
BANCARDQR_PUBLIC_KEY=
BANCARDQR_PRIVATE_KEY=
BANCARDQR_STAGING=
BANCARDQR_COMMERCE_CODE=
BANCARDQR_COMMERCE_BRANCH=
BANCARDQR_TIMEOUT=30
How to use
Using the Facade (recommended)
use KrugerDavid\LaravelBancardQR\Facades\BancardQR; $response = BancardQR::generateQr(50000, 'Payment description'); $response = BancardQR::revert($hookAlias);
Using dependency injection
use KrugerDavid\LaravelBancardQR\BancardQRManager; class PaymentController { public function __construct( private BancardQRManager $bancardQR ) {} public function create() { $response = $this->bancardQR->generateQr(50000, 'Payment'); } }
API estática legacy (retrocompatible)
use KrugerDavid\LaravelBancardQR\BancardQR; $response = BancardQR::generate_qr(50000, 'Descripción', $promotions); BancardQR::revert($hook_alias);
Nota: Se recomienda migrar al Facade o inyección de dependencias.
Respuestas de la API
Generate QR — estructura de respuesta
| Parameter | Type | Description |
|---|---|---|
status |
String | Indicates if the qr could be generated or not. |
qr_express |
QR object | Element with qr express data. |
supported_clients |
Array | List of clients that support payment with QR. |
QR Object
| Parameter | Type | Description |
|---|---|---|
amount |
Number | Amount in guaraníes. |
hook_alias |
String | Alias of the payment (from the QR) |
description |
String | Description of the sale entered by the merchant (Optional, the merchant may not enter a description) |
url |
String | URL where the generated QR image is located (in PNG format). This is the image that the store must display in its system. |
created_at |
String | Date time of creation of the QR in format dd/mm/yyyy HH:mm:ss |
qr_data |
String | QR data in EMVCo format. |
Supported Clients List
| Parameter | Type | Description |
|---|---|---|
name |
String | Client name. |
logo_url |
String | Client logo url |
Revert — estructura de respuesta
| Parameter | Type | Description |
|---|---|---|
status |
String | Indicates if the qr could be reversed or not. |
reverse |
QR object | Element with info of the QR reverted |
messages |
Array | In case of status error, list of errors |
Credits
License
The MIT License (MIT). Please see License File for more information
krugerdavid/laravel-bancard-qr 适用场景与选型建议
krugerdavid/laravel-bancard-qr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 9, 最近一次更新时间为 2023 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payments」 「laravel」 「qr」 「Paraguay」 「bancard」 「krugerdavid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 krugerdavid/laravel-bancard-qr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 krugerdavid/laravel-bancard-qr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 krugerdavid/laravel-bancard-qr 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
Laravel Migration Files for Paraguay Regions
Alfabank REST API integration
MercadoLibre integration with Magento 2
This laravel package fetch, search and retrieve RUC codes from the official taxes database from SET. Este es un paquete de laravel para descargar, buscar y brindar información sobre los numeros de RUC desde la fuente oficial del SET en Paraguay.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-21