Laravel interface for AtFawry
Install via composer
composer require maherelgamil/laravel-fawry
And then publish config
php artisan vendor:publish --tag="fawry-config"
Add merchant_code
, security_key
that's provided from Atfawry account
Now, Run migration
php artisan migrate
// Get user
$user = App\User::find(1);
$tokenResponse = Fawry::createCardToken($cardNumber, $expiryYear, $expiryMonth, $cvv, $user);
// Get user
$user = App\User::find(1);
Fawry::listCustomerTokens($user);
// Get user
$user = App\User::find(1);
Fawry::deleteCardToken($user);
// Get user
$user = App\User::find(1);
Fawry::chargeViaCard($merchantRefNum, $user, $amount, $chargeItems = [], $description = null )
// Get user
$user = App\User::find(1);
Fawry::chargeViaFawry($merchantRefNum, $user, $paymentExpiry, $amount, $chargeItems = [], $description = null )
Fawry::refund($fawryRefNumber, $refundAmount, $reason = null)
Laravel Fawry is an open-sourced laravel package licensed under the MIT license
Enjoy!