ahmedmahfouz / paymob
handle payment integration with paymob
v1.3
2023-10-14 19:36 UTC
Requires
- php: ^7.3|^8.0
README
####Note: This is a version Beta and I wish to complete all my ideas in this package.
sample package for laravel applications to integrate with PayMob payment gateway
Hi, I'm Ahmed MAhfouz! 👋
🚀 About Me
I'm a Software Engineer...
Installation
Install with composer
composer require ahmedmahfouz/paymob
Add service Provider in config/app.php
\Ahmedmahfouz\Paymob\PaymobServiceProvider::class,
Environment Variables
To run this package, you will need to add the following environment variables to your .env file
PAYMOBTOKEN
VISAINTEGRATIONID
VISAIFRAMEID
WALLETINTEGRATIONID
AMANINTEGRATIONID
PAYMOBHMAC
OR run command:
php artisan vendor:publish --tag=paymob-config
view for testing ?
/paymob-check-view
php artisan vendor:publish --tag=paymob-view
How to use ?
example for pay
$amout = 50 ; $billing = ['first_name' => 'ahmed' , 'last_name'=> 'mohamed' , 'email'=> 'admin@admin.com' , 'phone_number' => '01019208066' ]; $orderId = rand(1,3000); $service = $request->service; if($request->service == 'MOBILE_WALLET'){ $integrationId = env('WALLETINTEGRATIONID'); }else{ $integrationId = env('VISAINTEGRATIONID'); } return (new PayMobService)->pay($amout , $billing , $orderId , $service ,$integrationId);
example for checkout
return (new PayMobService)->callback($request);
Support
For support, email ahmedmahfouz2060@gmail.com