PHP code example of basha-nasar / pay-buddy

1. Go to this page and download the library: Download basha-nasar/pay-buddy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

basha-nasar / pay-buddy example snippets



ashaNasar\PayBuddy\PayBuddy;

$payBuddy = new PayBuddy();
echo $payBuddy->processPayment(100, 'USD');

return [
    'components' => [
        'payBuddy' => [
            'class' => \BashaNasar\PayBuddy\PayBuddy::class,
        ],
    ],
];

Yii::$app->payBuddy->processPayment(250, 'EUR');


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);
    }
}

pay-buddy/
├── composer.json
├── src/
│   └── PayBuddy.php
├── tests/
│   └── PayBuddyTest.php
└── README.md