basha-nasar / pay-buddy
A payment manager library built on Yii2
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/basha-nasar/pay-buddy
Requires
- php: >=7.4
- yiisoft/yii2: ^2.0
This package is not auto-updated.
Last update: 2025-12-17 15:47:26 UTC
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