kaninstein/multi-acquirer-checkout
Composer 安装命令:
composer require kaninstein/multi-acquirer-checkout
包简介
Multi-acquirer checkout package with DDD architecture for Laravel
README 文档
README
Headless Laravel package for multi-acquirer payments with a fallback gateway pipeline and fee calculation.
- Multiple gateways with priority + optional preferred gateway
- Card / PIX / boleto (per-gateway support)
- Deterministic fee breakdown (platform fee + gateway fee + financing cost)
- Optional published HTTP routes (API-first)
- Optional package migrations (or pure-config/in-memory mode)
Requirements
- PHP
^8.2 - Laravel
^10|^11|^12
Installation (Packagist)
composer require kaninstein/multi-acquirer-checkout:^1.0
Configuration
Publish the config file:
php artisan vendor:publish --tag=multi-acquirer-config
Enable routes (optional):
MULTI_ACQUIRER_ROUTES_ENABLED=true MULTI_ACQUIRER_ROUTES_PREFIX=api/multi-acquirer
Enable package migrations (optional):
MULTI_ACQUIRER_DATABASE_USE_PACKAGE_MIGRATIONS=true
Then publish and run:
php artisan vendor:publish --tag=multi-acquirer-migrations php artisan migrate
API routes (optional)
When MULTI_ACQUIRER_ROUTES_ENABLED=true, these routes are available under MULTI_ACQUIRER_ROUTES_PREFIX (default: api/multi-acquirer):
POST /api/multi-acquirer/checkoutPOST /api/multi-acquirer/feesGET /api/multi-acquirer/boleto/barcode
POST /checkout
Creates a payment attempt using the gateway pipeline and returns:
- payment snapshot (status + metadata)
- fee breakdown
- gateway response payload (normalized)
Request body:
{
"amount_cents": 10000,
"currency": "BRL",
"payment_method": "pix",
"installments": 1,
"customer": { "name": "John Doe", "email": "john@example.com", "document": "123.456.789-00" },
"gateway": "pagarme",
"platform_fee_rate": 0.06,
"merchant_absorbs_financing": false,
"fee_responsibility": "buyer",
"metadata": { "order_id": 123, "description": "Product X", "item_code": "product_123" }
}
Notes:
platform_fee_rateis optional. If omitted, the package usesmulti-acquirer.fees.platform.default_rate.merchant_absorbs_financingcontrols who pays installment financing.fee_responsibilitycontrols gross-up behavior (buyervsmerchant).
POST /fees
Computes the fee breakdown without creating a gateway payment (useful for checkout previews).
Request body:
{
"amount_cents": 10000,
"payment_method": "card",
"installments": 3,
"gateway": "pagarme",
"platform_fee_rate": 0.06,
"merchant_absorbs_financing": false,
"fee_responsibility": "buyer"
}
Response contains fees with fields like:
platform_fee_amount_centsgateway_fee_centsfinancing_cost_centsamount_paid_by_customer_centsmerchant_net_amount_cents
Using the package services (no routes)
If you prefer, call the services directly:
Kaninstein\MultiAcquirerCheckout\Application\Services\CheckoutServiceKaninstein\MultiAcquirerCheckout\Domain\Fee\Services\FeeCalculator
The main input DTO is:
Kaninstein\MultiAcquirerCheckout\Application\DTOs\PaymentRequest
Multi-tenant / SaaS setup
This package reads gateway and fee settings from config('multi-acquirer'). In a SaaS, you typically store a JSON blob per tenant/producer in your own database and hydrate Laravel config at runtime (middleware/service provider) before calling the package.
Recommended approach:
- Store tenant payload under one key (e.g.
multi_acquirer) in your app settings table. - On each request, set
config(['multi-acquirer' => $payload])(or merge the relevant portions). - Keep the payment domain inside this package; keep only project-specific mapping in your app.
Development
composer test
composer phpstan
composer format
kaninstein/multi-acquirer-checkout 适用场景与选型建议
kaninstein/multi-acquirer-checkout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「checkout」 「stripe」 「laravel」 「ddd」 「pagarme」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kaninstein/multi-acquirer-checkout 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kaninstein/multi-acquirer-checkout 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kaninstein/multi-acquirer-checkout 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Flexible payment integration for Laravel, lunarphp, supporting multiple payment providers.
Adds a 'checkout' to a SilverStripe site which links to an Estimate and adds the ability to setup and pay
Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
Add a simple webshop to your Laravel project
Customer notes for Contao Isotope eCommerce checkout.
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-15