vp-trading/moneyman
Composer 安装命令:
composer require vp-trading/moneyman
包简介
README 文档
README
Installation
To install the MoneyMan package, follow these steps:
-
Require the package via Composer:
composer require vp-trading/moneyman
-
Publish the configuration, route, and migration files:
php artisan vendor:publish --provider="Vptrading\MoneyMan\MoneyManServiceProvider"The package comes with a config files to help you get started quickly.
-
Configure your
.envfile:Add your Providers API keys:
MONEYMAN_REF_PREFIX= MONEYMAN_CHAPA_SECRET_KEY= MONEYMAN_CHAPA_BASE_URL= MONEYMAN_CHAPA_CALLBACK_URL= MONEYMAN_CHAPA_WEBHOOK_SECRET= MONEYMAN_SANTIMPAY_BASE_URL= MONEYMAN_SANTIMPAY_PUBLIC_KEY= MONEYMAN_SANTIMPAY_PRIVATE_KEY= MONEYMAN_SANTIMPAY_MERCHANT_ID= MONEYMAN_SANTIMPAY_TOKEN= MONEYMAN_SANTIMPAY_CALLBACK_URL= MONEYMAN_TELEBIRR_MERCHANT_APP_ID= MONEYMAN_TELEBIRR_FABRIC_APP_ID= MONEYMAN_TELEBIRR_SHORT_CODE= MONEYMAN_TELEBIRR_APP_SECRET= MONEYMAN_TELEBIRR_PRIVATE_KEY= MONEYMAN_TELEBIRR_BASE_URL= MONEYMAN_TELEBIRR_TIMEOUT= MONEYMAN_TELEBIRR_CALLBACK_URL= MONEYMAN_TELEBIRR_WEB_BASE_URL= MONEYMAN_BOA_USSD_BASE_URL= MONEYMAN_BOA_USSD_CLIENT_ID= MONEYMAN_BOA_USSD_CLIENT_SECRET= MONEYMAN_BOA_USSD_REFRESH_TOKEN= MONEYMAN_BOA_USSD_MERCHANT_NAME= MONEYMAN_BOA_USSD_MERCHANT_ACCOUNT= MONEYMAN_BOA_USSD_API_KEY=
-
Ready to use!
You can now use the package in your Laravel application.
Support
| Provider | Payment Initialize | Payment Verify | Payment Refund |
|---|---|---|---|
| Chapa | ✅ | ✅ | ✅ |
| Telebirr | ✅ | ✅ | ✅ |
| SantimPay | ✅ | ✅ | ❌ |
| BoaUssd | ✅ | ✅ | ❌ |
Usage
Before you start using this package you should know all amount must be put in cent values. The development of this package took standards from Stripe. So for example if you want the amount be 100 Birr you will put 10000.
Here are some basic usage examples:
Initialize Payment
use Vptrading\MoneyMan\MoneyMan; use Vptrading\MoneyMan\Enums\Provider; use Vptrading\MoneyMan\ValueObjects\User; use Money\Money; $response = MoneyMan::provider(Provider::Chapa)->initiate([ Money::ETB(10000), new User( firstName: 'John', lastName: 'Doe', email: 'johndoe@example.com', phoneNumber: '0912345678' ), route('return-url') ]); // Redirect user to payment page return redirect($response->checkoutUrl);
The initiate response is a DTO that consists of the status of of the request, message if the provider has one, transactionId, and checkoutUrl if the request was successful.
For telebirr you will need to wrap the
checkoutUrlprovided in an<a>tag for it to work or else you will see an error: "Payment cannot be completed. The required parameter of the request is empty, or the parameter is incorrectly filled."For
BoaUssd, there is nocheckoutUrlbecause it is a USSD flow. The provider returns once the user PIN interaction is completed on the phone.
Verify Payment
use Vptrading\MoneyMan\MoneyMan; use Vptrading\MoneyMan\Enums\Provider; use Money\Money; $response = MoneyMan::provider(Provider::Chapa)->verify($transactionId);
The verify response is a DTO that consists of the status of of the request, message if the provider has one, transactionId, and data which is the response from the provider.
For
BoaUssd, pass thebillNumber(reference) returned during initiate as thetransactionIdtoverify(). The package verifies usingGET /ussd/push/getStatus?reference={billNumber}.
BoaUssdtokens are persisted in theboa_tokenstable and are encrypted at rest using Laravel encrypted model casts. On expired access token /401, the package refreshes with refresh token and retries once automatically.
Refund Payment
use Vptrading\MoneyMan\MoneyMan; use Vptrading\MoneyMan\Enums\Provider; use Money\Money; $response = MoneyMan::provider(Provider::Chapa)->refund($transactionId, Money::ETB(1000));
The refund response is a DTO that consists of the status of of the request, message if the provider has one, transactionId, and data which is the response from the provider.
Note: Chapa's refund does not use the transactionId you provided but instead the reference Id they assign to the transaction.
vp-trading/moneyman 适用场景与选型建议
vp-trading/moneyman 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 287 次下载、GitHub Stars 达 3, 最近一次更新时间为 2025 年 09 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「integration」 「chapa」 「santimPay」 「Telebirr」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vp-trading/moneyman 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vp-trading/moneyman 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vp-trading/moneyman 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Package to Accept Payment through Chapa
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
Laravel integration for blade-to-react
The missing social authentication for thephpleague/oauth2-server, adapted from schedula/league-oauth2-social
统计信息
- 总下载量: 287
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-22