ahmard / flutterwave
Flutterwave PHP API client
0.0.7
2023-02-11 01:29 UTC
Requires
- php: ^8.1
- ext-json: *
- ahmard/guzwrap: ^2.4
Requires (Dev)
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^3.7
- symfony/var-dumper: ^3.2
README
Flutterwave API client.
Installation
composer require ahmard/flutterwave
Create Transaction
use Ahmard\Flutterwave\Config; use Ahmard\Flutterwave\Transaction; use Ahmard\Flutterwave\TransactionData; require 'vendor/autoload.php'; Config::privateKey('<Your-Private-Key-Here>'); $data = TransactionData::create() ->reference(uniqid()) ->amount(100) ->paymentOption('card,banktransfer,ussd') ->customerName('Aminu Mustapha') ->customerEmail('ahmard06@gmail.com') ->customerPhoneNumber(7035636394) ->customerId(1) ->redirectUrl('http://localhost:8800/redir'); $payment = Transaction::create($data); var_dump($payment->redirectLink());
Transaction Verification
use Ahmard\Flutterwave\Transaction; $verification = Transaction::verify('2323'); var_dump($verification->isSuccessful()); var_dump($verification->isFailed()); var_dump($verification->txRef()); var_dump($verification->currency()); var_dump($verification->amount());
Transaction::verify() returns instance of TransactionVerificationResponse
Enjoy accepting payments 😎