maree/fawry

package to pay with fawry payment services

dev-main 2022-06-12 18:58 UTC

This package is auto-updated.

Last update: 2024-10-12 23:50:59 UTC


README

Installation

You can install the package via Composer.

composer require maree/fawry

Publish your fawry config file with

php artisan vendor:publish --provider="Maree\Fawry\FawryServiceProvider" --tag="fawry"

then change your fawry config from config/fawry.php file

    "mode"                => "test",//live
    "currency"            => "EGP" ,

Usage

create Card Token

use Maree\Fawry\Fawry;
    $customer_data = ['customer_id' => '1', 'customer_mobile' => '010027*****', 'customer_email' => 'm7mdmaree26@gmail.com'];
    $card_data     = ['card_number' => '1111111111111','expiry_year' => 2023, 'expiry_month' => '05', 'cvv' => '123', 'is_default' => false];
Fawry::createCardToken($customer_data = [], $card_data = []);  

list Customer Tokens

use Maree\Fawry\Fawry;
Fawry::listCustomerTokens($customer_id);  

delete Card Token

use Maree\Fawry\Fawry;
Fawry::deleteCardToken($customer_id='', $customer_card_token='');  

pay By Card Token

use Maree\Fawry\Fawry;
Fawry::payByCardToken($merchantRefNum='', $customer_card_token='', $customer_data =[], $amount = 1 , $chargeItems = [], $description = ''); 

pay By Card Token 3DS

use Maree\Fawry\Fawry;
	$customer_data = ['customer_id' => '1','customer_name' => 'mohamed maree' 'customer_mobile' => '010027*****', 'customer_email' => 'm7mdmaree26@gmail.com'];
Fawry::payByCardToken3DS($merchantRefNum='', $customer_card_token='', $cvv='', $customer_data = [], $amount = 1 , $callbackURL='', $chargeItems = [], $authCaptureModePayment = false, $language = 'en-gb', $description = '');

pay By Card

use Maree\Fawry\Fawry;
    $customer_data = ['customer_id' => '1','customer_name' => 'mohamed maree' 'customer_mobile' => '010027*****', 'customer_email' => 'm7mdmaree26@gmail.com'];
    $card_data     = ['card_number' => '11111**********','card_expiry_year' => '23', 'card_expiry_month' => '05','cvv' =>'123'];
Fawry::payByCard($merchantRefNum='', $card_data = [], $customer_data = [], $amount= 1, $chargeItems = [], $language = 'en-gb' , $description = '');

pay By Card 3DS

use Maree\Fawry\Fawry;
    $customer_data = ['customer_id' => '1','customer_name' => 'mohamed maree' 'customer_mobile' => '010027*****', 'customer_email' => 'm7mdmaree26@gmail.com'];
    $card_data     = ['card_number' => '11111**********','card_expiry_year' => '23', 'card_expiry_month' => '05','cvv' =>'123'];
Fawry::payByCard3DS($merchantRefNum='', $card_data = [], $customer_data = [], $amount =1 , $calbackURL='', $chargeItems = [], $authCaptureModePayment = false, $language = 'en-gb' , $description = '');

charge Via Fawry

use Maree\Fawry\Fawry;
    $customer_data = ['customer_id' => '1','customer_name' => 'mohamed maree' 'customer_mobile' => '010027*****', 'customer_email' => 'm7mdmaree26@gmail.com'];
    $card_data     = ['card_number' => '11111**********','card_expiry_year' => '23', 'card_expiry_month' => '05','cvv' =>'123'];
Fawry::chargeViaFawry($merchantRefNum='', $customer_data = [], $paymentExpiry='', $amount = 1, $chargeItems = [], $description = '' );

refund

use Maree\Fawry\Fawry;
Fawry::refund($referenceNumber='', $refundAmount=1, $reason = '');

cancel Unpaid Payment

use Maree\Fawry\Fawry;
Fawry::cancelUnpaidPayment($orderReferenceNumber='', $lang = 'en-gb') ;

Test Cards.

documentaion