PHP code example of fannypack / beyonic

1. Go to this page and download the library: Download fannypack/beyonic 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/ */

    

fannypack / beyonic example snippets


FannyPack\Beyonic\BeyonicServiceProvider::class,

'Beyonic' => FannyPack\Beyonic\Beyonic::class,

php artisan vendor:publish

beyonic.php

php artisan migrate

namespace App;

use FannyPack\Beyonic\Billable;
use Illuminate\Database\Eloquent\Model;

class Account extends Model
{
    use Billable;
}

$account = Account::find(1);
$payment = Beyonic::deposit($account, $amount, $reason, $optional_phone_number);
// or
$payment = $account->deposit($amount, $reason, $optional_phone_number);

$payment = $account->payments[0]
$response = Beyonic::info($payment);
// or
$response = $payment->info();

$payment = Beyonic::withdraw($account, $amount, $reason, $optional_phone_number);
// or
$payment = $account->withdraw($amount, $reason, $optional_phone_number);