upgradelabs/ifthenpay
Composer 安装命令:
composer require upgradelabs/ifthenpay
包简介
Laravel package for Ifthenpay API integration (Multibanco, MBWay, Credit Card, Google Pay, Apple Pay, Refunds)
README 文档
README
This package provides an easy integration with the Ifthenpay API for Laravel projects.
Version compatibility
| Package version | Laravel versions supported |
|---|---|
| ^1.0 | 8.x, 9.x, 10.x |
| ^2.0 | 11.x, 12.x |
Installation
Choose the right version for your project:
# Laravel 8–10 composer require upgradelabs/ifthenpay:^1.0 # Laravel 11–12 composer require upgradelabs/ifthenpay:^2.0
Publish the configuration file:
php artisan vendor:publish --provider="Upgradelabs\Ifthenpay\IfthenpayServiceProvider" --tag="config"
Set your API keys in your .env file:
IFTHENPAY_SANDBOX=true
IFTHENPAY_MB_KEY=MBK-xxxxxxxx
IFTHENPAY_MBWAY_KEY=MBWAY-xxxxxxxx
IFTHENPAY_CCARD_KEY=CCARD-xxxxxxxx
IFTHENPAY_GATEWAY_KEY=GWK-xxxxxxxx
IFTHENPAY_GOOGLE_KEY=GOOGLE-xxxxxxxx
IFTHENPAY_APPLE_KEY=APPLE-xxxxxxxx
IFTHENPAY_BACKOFFICE_KEY=BACKOFFICE-xxxxxxxx
Usage
Use the Ifthenpay facade for all operations:
use Ifthenpay; // Create Multibanco Reference $response = Ifthenpay::createMultibancoReference([ 'orderId' => 'order-1234', 'amount' => '123.45', 'description' => 'Order description', 'url' => 'https://example.com', 'expiryDays' => 3, ]); // Initiate MB WAY payment $response = Ifthenpay::createMbwayPayment([ 'orderId' => 'order-1234', 'amount' => '123.45', 'mobileNumber' => '912345678', ]); // Check MB WAY payment status $status = Ifthenpay::getMbwayStatus($response['RequestId']); // Initialize Credit Card payment $response = Ifthenpay::initCreditCardPayment([ 'orderId' => 'order-1234', 'amount' => '123.45', 'successUrl' => 'https://example.com/success', 'errorUrl' => 'https://example.com/error', 'cancelUrl' => 'https://example.com/cancel', 'language' => 'en', ]); // Create Google Pay payment $response = Ifthenpay::createGooglePayPayment([ 'id' => 'order-1234', 'amount' => '123.45', 'description' => 'Order description', 'lang' => 'en', 'expiredate' => '20250101', 'btnCloseUrl' => 'https://example.com/close', 'btnCloseLabel' => 'Close', 'success_url' => 'https://example.com/success', 'error_url' => 'https://example.com/error', 'cancel_url' => 'https://example.com/cancel', ]); // Create Apple Pay payment $response = Ifthenpay::createApplePayPayment([ 'id' => 'order-1234', 'amount' => '123.45', ]); // Issue a refund $response = Ifthenpay::refund('request-id-123', '50.00');
Testing
Run the tests with:
vendor/bin/phpunit
License
MIT
upgradelabs/ifthenpay 适用场景与选型建议
upgradelabs/ifthenpay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 92 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 upgradelabs/ifthenpay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 upgradelabs/ifthenpay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 92
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-28