/laravel-fawry

Atfawy interface for larvel

Primary LanguagePHPMIT LicenseMIT

Laravel Fawry

Latest Stable Version Total Downloads Latest Unstable Version License StyleCI

Laravel interface for AtFawry

Table Of Contect

Installation

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

Usage

Create Card Token:

// Get user
$user = App\User::find(1);

$tokenResponse = Fawry::createCardToken($cardNumber, $expiryYear, $expiryMonth, $cvv, $user);

Get List Of Customer Tokens:

// Get user
$user = App\User::find(1);

Fawry::listCustomerTokens($user);

Delete Customer Token

// Get user
$user = App\User::find(1);

Fawry::deleteCardToken($user);

Charge:

Charge Via Card:

// Get user
$user = App\User::find(1);

Fawry::chargeViaCard($merchantRefNum, $user, $amount, $chargeItems = [], $description = null )

Charge Via Fawry

// Get user
$user = App\User::find(1);

Fawry::chargeViaFawry($merchantRefNum, $user, $paymentExpiry, $amount, $chargeItems = [], $description = null )

Refund

Fawry::refund($fawryRefNumber, $refundAmount, $reason = null)

License

Laravel Fawry is an open-sourced laravel package licensed under the MIT license

Enjoy!