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

v1.0.0 2025-12-02 17:15 UTC

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

๐ŸŒŸ Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit changes (git commit -m "Add my feature")
  4. Push to branch (git push origin feature/my-feature)
  5. Open a Pull Request

๐Ÿ“ฆ Versioning

We use Semantic Versioning.

  • MAJOR version for incompatible API changes
  • MINOR version for new functionality in a backwards-compatible manner
  • PATCH version for backwards-compatible bug fixes