basha-nasar/pay-buddy
最新稳定版本:v1.0.0
Composer 安装命令:
composer require basha-nasar/pay-buddy
包简介
A payment manager library built on Yii2
README 文档
README
PayBuddy is a lightweight payment manager library built on Yii2.
It provides a simple interface for handling and logging payments, and can be registered as a Yii component for seamless integration.
🚀 Installation
Install via Composer:
composer require basha-nasar/pay-buddy
If the package is not yet published on Packagist, you can require it directly from GitHub:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Basha-Nasar/pay-buddy"
}
],
"require": {
"basha-nasar/pay-buddy": "dev-main"
}
}
📂 Project Structure
pay-buddy/
├── composer.json
├── src/
│ └── PayBuddy.php
├── tests/
│ └── PayBuddyTest.php
└── README.md
🧑💻 Usage
Standalone Example
<?php require __DIR__ . '/vendor/autoload.php'; use BashaNasar\PayBuddy\PayBuddy; $payBuddy = new PayBuddy(); echo $payBuddy->processPayment(100, 'USD');
Output:
Payment of 100 USD processed successfully.
Yii2 Component Integration
Register PayBuddy as a component in your Yii2 configuration:
return [ 'components' => [ 'payBuddy' => [ 'class' => \BashaNasar\PayBuddy\PayBuddy::class, ], ], ];
Then use it anywhere in your Yii2 app:
Yii::$app->payBuddy->processPayment(250, 'EUR');
🧪 Testing
Run unit tests with PHPUnit:
vendor/bin/phpunit tests
Example test (tests/PayBuddyTest.php):
<?php use PHPUnit\Framework\TestCase; use BashaNasar\PayBuddy\PayBuddy; class PayBuddyTest extends TestCase { public function testProcessPayment() { $payBuddy = new PayBuddy(); $result = $payBuddy->processPayment(50, 'EUR'); $this->assertStringContainsString('50 EUR', $result); } }
📜 License
This project is licensed under the MIT License.
👤 Author
- NasarBashaG
Developer of PayBuddy
Email: your-email@example.com
🌟 Contributing
Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit changes (
git commit -m "Add my feature") - Push to branch (
git push origin feature/my-feature) - Open a Pull Request
📦 Versioning
We use Semantic Versioning.
MAJORversion for incompatible API changesMINORversion for new functionality in a backwards-compatible mannerPATCHversion for backwards-compatible bug fixes
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-02