12goyuriyr/symfony-mono-acquiring-bundle
Composer 安装命令:
composer require 12goyuriyr/symfony-mono-acquiring-bundle
包简介
Symfony bundle for Monobank Acquiring API integration (invoices, payments, currency rates)
README 文档
README
Symfony bundle providing a typed HTTP client for Monobank Acquiring API.
Features
- Create payment invoices
- Check invoice status
- Fetch currency exchange rates
- Typed DTOs instead of raw arrays
- Auto-configured via Symfony DI
Requirements
- PHP 8.1+
- Symfony 6.4 / 7.x / 8.x
Installation
Step 1: Install the package
composer require 12goyuriyr/symfony-mono-acquiring-bundle
Symfony Flex will automatically register the bundle in config/bundles.php. If it didn't, add it manually:
return [ // ... MonobankAcquiring\MonobankAcquiringBundle::class => ['all' => true], ];
Step 2: Configure
Add your Monobank merchant token to .env:
MONO_API_TOKEN=your_token_here
Create the bundle configuration file:
# config/packages/monobank_acquiring.yaml monobank_acquiring: api_token: '%env(MONO_API_TOKEN)%' # api_url: 'https://api.monobank.ua' # optional, this is the default
That's it. MonoAcquiringClientInterface is now available for dependency injection.
Usage
Inject MonoAcquiringClientInterface into your service:
use MonobankAcquiring\Client\MonoAcquiringClientInterface; class PaymentService { public function __construct( private readonly MonoAcquiringClientInterface $monoClient, ) {} public function createPayment(): string { $invoice = $this->monoClient->createInvoice([ 'amount' => 10000, // amount in kopiykas (100.00 UAH) 'ccy' => 980, // ISO 4217 currency code (UAH) 'merchantPaymInfo' => [ 'reference' => 'Order #123', 'destination' => 'Payment for order #123', ], 'redirectUrl' => 'https://example.com/payment/callback', 'webHookUrl' => 'https://example.com/payment/webhook', 'validity' => 3600, ]); // Redirect user to $invoice->getPageUrl() return $invoice->getInvoiceId(); } public function checkStatus(string $invoiceId): bool { $status = $this->monoClient->getInvoiceStatus($invoiceId); return $status->isSuccess(); } }
Available methods
createInvoice(array $payload): InvoiceResponse
Creates a payment invoice. Returns InvoiceResponse with getInvoiceId() and getPageUrl().
See Monobank API docs for payload options.
getInvoiceStatus(string $invoiceId): InvoiceStatus
Returns InvoiceStatus with:
getStatus()— raw status stringisCreated(),isProcessing(),isSuccess(),isFailure(),isExpired(),isReversed()— status checksgetAmount(),getFinalAmount(),getCcy()— payment amountsgetFee()— gateway feegetPaymentInfo()— raw payment info array
getRates(): Rate[]
Returns an array of Rate objects with:
getCurrencyCodeA(),getCurrencyCodeB()— ISO 4217 codesgetDate()— Unix timestampgetRateSell(),getRateBuy(),getRateCross()— exchange rates
Error handling
All API errors throw MonoApiException:
use MonobankAcquiring\Exception\MonoApiException; try { $invoice = $monoClient->createInvoice($payload); } catch (MonoApiException $e) { $e->getMessage(); // error description $e->getHttpStatusCode(); // HTTP status code $e->getResponseBody(); // raw response array }
License
MIT
12goyuriyr/symfony-mono-acquiring-bundle 适用场景与选型建议
12goyuriyr/symfony-mono-acquiring-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「payment」 「ukraine」 「acquiring」 「monobank」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 12goyuriyr/symfony-mono-acquiring-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 12goyuriyr/symfony-mono-acquiring-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 12goyuriyr/symfony-mono-acquiring-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The bundle for easy using json-rpc api on your project
Ukraine Identification Number
Bundle Symfony DaplosBundle
TurboSMS HTTP API library, This package allows easy notification sending using [turbosms.ua](https://turbosms.ua). Optimized for php5.4 and above
Powerful & Simple NovaPoshta API SDK for PHP
Laravel notification channel for the TurboSMS REST API
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 42
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-21