laravel-pay/fawry
Composer 安装命令:
composer require laravel-pay/fawry
包简介
This is my package fawry
README 文档
README
Fawry is a Laravel package for the Fawry payment gateway (EGYPT).
Contents
Installation
You can install the package via composer:
composer require laravel-pay/fawry
You can publish and run the Translations with:
php artisan vendor:publish --tag="fawry-translations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="fawry-config"
This is the contents of the published config file:
<?php // config for LaravelPay/Fawry return [ "staging" => [ 'url' => env('FAWRY_STAGING_URL', "https://atfawry.fawrystaging.com/"), 'secret' => env('FAWRY_STAGING_SECRET'), 'merchant' => env('FAWRY_STAGING_MERCHANT'), ], "live" => [ 'url' => env('FAWRY_LIVE_URL', "https://www.atfawry.com/"), 'secret' => env('FAWRY_LIVE_SECRET'), 'merchant' => env('FAWRY_LIVE_MERCHANT'), ], // required allowed values [POPUP, INSIDE_PAGE, SIDE_PAGE , SEPARATED] 'display_mode' => env('FAWRY_DISPLAY_MODE',"POPUP"), // allowed values ['CashOnDelivery', 'PayAtFawry', 'MWALLET', 'CARD' , 'VALU'] 'pay_mode'=>env('FAWRY_PAY_MODE',"CARD"), "verify_route_name" => env('FAWRY_VERIFY_ROUTE_NAME', "fawry.verify"), "locale" => env('FAWRY_LOCALE', "ar"), // ar or en "language" => env('FAWRY_LANGUAGE', "ar-eg"), // ar-eg or en-us ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="fawry-views"
Usage
- add this to your .env file
FAWRY_STAGING_MERCHANT="" FAWRY_STAGING_SECRET=""
- Pay Route
Route::get("/fawry" , function(){ $form = Fawry::setOnStagingMode() ->setAmount(100.12) ->setUserId(11111) ->setUserFirstName("ahmed") ->setUserLastName("elsayed") ->setUserEmail("ahmed_elsayed@gmail.com") ->setUserPhone("01000000000") ->pay(); return view("welcome" , [ "form" => $form['html'] ]); });
- Verify Route
note : you can change the verify route name in config file
Route::get("/fawry/verify" , function(){ $response = Fawry::setOnStagingMode()->verify(); dd($response); })->name("fawry.verify");
Changelog
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Security
Please review our security policy on how to report security vulnerabilities.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-15