prosperoking / paystack
A Simple Wrapper for paystack transfer api
v0.2.1
2020-11-18 15:05 UTC
Requires
- guzzlehttp/guzzle: ~6.5|~7
- illuminate/support: ~5|~6|~7|~8
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4
- phpunit/phpunit: ^8.0
- sempro/phpunit-pretty-print: ^1.0
README
This is where your description should go. Take a look at contributing.md to see a to do list.
Installation
Via Composer
$ composer require prosperoking/paystack
After installing run vendor publish and select PaystackTransfer from the prompt
$ php artisan vendor:publish
Usage
- Validate an Account Number: Now you can have a bank account validator bankaccount to enable you to validate an account number you will need to pass the bankcode field to it.
Validator::validate($data,[ 'bankcode'=>'required|string', 'account_no'=>'required|bankaccount,bankcode' ])
- Get Banks
Paystack::getBanks(); // returns a laravel collection
- Create a transfer Recipient
\PaystackTransfer::createTransferReciept($account_no,$bank_code, $account_name);
- Make a transfer
\PaystackTransfer::transfer($recipient_code, $amount, $reason);
- Get transfer
\PaystackTransfer::fetchTransfer(string $id_or_code);
- Get Transfer Balance
\PaystackTransfer::balance()
- Make Bulk Transfer
$payload = $transfers->map(fn(Transfer $transfer)=>[ 'reference'=>$transfer->id, 'recipient'=>$transfer->recipient, 'amount'=> (int) round($transfer->amount * 100) ])->toArray(); \PaystackTransfer::bulkTransfer($payload);
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.