bornmt/laravel-apcopay
Composer 安装命令:
composer require bornmt/laravel-apcopay
包简介
Laravel integration for ApcoPay payment gateway (hosted page and payment status)
README 文档
README
Laravel integration for the ApcoPay payment gateway: hosted payment page and payment status (GetPayment / PreparePayment).
Requirements
- PHP 8.2+
- Laravel 10.x, 11.x or 12.x
- GuzzleHTTP 7.x
Installation
composer require bornmt/laravel-apcopay
Publish the config file (optional; defaults are used from the package):
php artisan vendor:publish --tag=apcopay-config
Configuration
Add to your .env:
APCO_PAY_ENV=local APCO_PAY_USERNAME= APCO_PAY_PASSWORD= APCO_PAY_PID= APCOPAY_BASE_URL=https://www.apsp.biz/GPG/RESTAPI/api/OnlinePayments APCOPAY_SANDBOX_BASE_URL=https://www.apsp.biz/GPGTest/RESTAPI/api/OnlinePayments
Set APCO_PAY_ENV=production for live payments.
After publishing the config, you can optionally customize http (e.g. timeout, connect_timeout) for the Guzzle client.
Usage
Inject BornMT\ApcoPay\Contracts\ApcoPayServiceInterface:
use BornMT\ApcoPay\Contracts\ApcoPayServiceInterface; use BornMT\ApcoPay\Enums\PaymentStateFields; // Get hosted page URL for redirect $response = $apcoPay->getHostedPage( sessionReference: $sessionReference, amount: $amount, returnUrl: $returnUrl ); $paymentUrl = $response['paymentURLField']; // Get payment status $payment = $apcoPay->getPayment($sessionReference); // Get payment with retries (e.g. while processing) $payment = $apcoPay->getPaymentWithRetry($sessionReference, 3); // Check state PaymentStateFields::PENDING->value; // 1 PaymentStateFields::CANCELLED->value; // 2 PaymentStateFields::SUCCESS->value; // 3 PaymentStateFields::FAILED->value; // 4
Exceptions: the service throws BornMT\ApcoPay\Exceptions\ApcoPayException on API or retry failures.
Using the Facade
When the package is installed in a Laravel app, you can use the ApcoPay facade:
use BornMT\ApcoPay\Facades\ApcoPay; $response = ApcoPay::getHostedPage($sessionReference, $amount, $returnUrl); $payment = ApcoPay::getPayment($sessionReference); $payment = ApcoPay::getPaymentWithRetry($sessionReference, 3); // with retries
Testing
composer test
Or with PHPUnit directly:
./vendor/bin/phpunit
License
The MIT License (MIT). Please see the License File for more information.
bornmt/laravel-apcopay 适用场景与选型建议
bornmt/laravel-apcopay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gateway」 「laravel」 「apcopay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bornmt/laravel-apcopay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bornmt/laravel-apcopay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bornmt/laravel-apcopay 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
Alfabank REST API integration
GovPayNet driver for the Omnipay payment processing library
BlueSnap driver for the Omnipay payment processing library
统计信息
- 总下载量: 131
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-05