PHP code example of prosperoking / paystack

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

    

prosperoking / paystack example snippets



Validator::validate($data,[
    'bankcode'=>'ode'
])


    Paystack::getBanks(); // returns  a laravel collection



    \PaystackTransfer::createTransferReciept($account_no,$bank_code, $account_name);


    \PaystackTransfer::transfer($recipient_code, $amount, $reason);


    \PaystackTransfer::fetchTransfer(string $id_or_code);


    \PaystackTransfer::balance()


    $payload = $transfers->map(fn(Transfer $transfer)=>[
                    'reference'=>$transfer->id,
                    'recipient'=>$transfer->recipient,
                    'amount'=> (int) round($transfer->amount * 100)
                ])->toArray();
    \PaystackTransfer::bulkTransfer($payload);

bash
$ php artisan vendor:publish