sashalenz/monobank-api
Composer 安装命令:
composer require sashalenz/monobank-api
包简介
This is my package monobank-api
README 文档
README
A lightweight and expressive PHP wrapper for the Monobank API. It provides simple methods for accessing public banking information and personal account data.
Installation
You can install the package via composer:
composer require sashalenz/monobank-api
You can publish the config file with:
php artisan vendor:publish --tag="monobank-api-config"
This is the contents of the published config file:
return [
];
Usage
This package provides helpers for all Monobank API requests:
MonobankApi::bank()->currency()– get current currency exchange rates.MonobankApi::personal()->clientInfo()– retrieve information about accounts and cards.MonobankApi::personal()->webhook($url)– register a webhook URL for transaction updates.MonobankApi::personal()->statement($account, $dateFrom, $dateTo = null)– fetch a statement for a specific account and period.
Examples
Currency rates
Retrieve public exchange rates without authentication.
use Sashalenz\MonobankApi\MonobankApi; $rates = MonobankApi::bank()->currency(); foreach ($rates as $rate) { echo $rate->currencyCodeA . ' => ' . $rate->rateBuy . PHP_EOL; }
Client information
Get information about your accounts and cards.
$info = MonobankApi::personal()->token($token)->clientInfo();
Register webhook
Configure a webhook to receive transaction updates.
MonobankApi::personal()->token($token)->webhook('https://example.com/monobank');
Webhook route configuration
The package registers two inbound webhook routes (POST {prefix}/{webhook_key} and
POST {prefix}/{acquiring_webhook_key}). Where and how they mount is fully
configurable (Livewire-style) — set these in config/monobank-api.php or via env:
| Config / env | Default | Purpose |
|---|---|---|
webhook_routes_enabled / MONOBANK_WEBHOOK_ROUTES_ENABLED |
true |
Set false to skip route registration entirely (e.g. when you handle the webhook elsewhere). |
webhook_domain / MONOBANK_WEBHOOK_DOMAIN |
null (any host) |
Constrain the routes to a domain. |
webhook_prefix / MONOBANK_WEBHOOK_PREFIX |
monobank-api |
URL path prefix. |
webhook_middleware / MONOBANK_WEBHOOK_MIDDLEWARE |
[] |
Middleware/guards (env = comma-separated list). |
webhook_key / acquiring_webhook_key |
webhook / acquiring-webhook |
Path segment per controller. |
All defaults preserve the previous behaviour.
Account statement
Fetch the statement for an account within a given period.
$statement = MonobankApi::personal() ->token($token) ->statement($accountId, $dateFrom, $dateTo);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
sashalenz/monobank-api 适用场景与选型建议
sashalenz/monobank-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 136 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「sashalenz」 「monobank-api」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sashalenz/monobank-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sashalenz/monobank-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sashalenz/monobank-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
API for Binotel
Google Maps API SDK for Laravel
NovaPay Business Cabinet API client for Laravel
Alfabank REST API integration
Uklon Delivery Gateway API SDK for Laravel
Delivery Auto API client for Laravel
统计信息
- 总下载量: 136
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-24