paystar / laravel-ipg
A package for PayStar payment gateway and Those for whom time is important
v1.0.1
2023-02-07 19:11 UTC
Requires
- php: 7.*|8.*
- laravel/framework: 7.*|8.*|9.*
README
This is a Laravel package for PayStar payment gateway.
⬇️ Installation guide
Install package
composer require paystar/laravel-ipg
Publish configs
php artisan vendor:publish --tag=paystar-ipg
📖 List of available methods
create()
: return a tokenpayment()
: auto redirect to gatewayverify()
: verify transaction
✔️ How to use exists methods and options
-
Use
create()
method<?php use PayStar\Ipg\Facades\PayStarIpg; PayStarIpg::amount('AMOUNT') // * ->orderId('ORDER_ID') // * ->callbackUrl('CALLBACK_URL') // If You don't use this method, we set this from config ->sign('SIGN') // If You don't use this method, we generate auto a sign ->create();
List of extra option
How to use this options
<?php use PayStar\Ipg\Facades\PayStarIpg; PayStarIpg::amount('AMOUNT') // * ->orderId('ORDER_ID') // * ->callbackUrl('CALLBACK_URL') // If You don't use this method, we set this from config ->sign('SIGN') // If You don't use this method, we generate auto a sign ->option([ 'name' => 'Name', 'phone' => 'PHONE', 'mail' => 'MAIL', 'description' => 'DESCRIPTION', 'allotment' => 'ALLOTMENT', 'callback_method' => 'CALLBACK_METHOD', 'wallet_hashid' => 'WALLET_HASHID', 'national_code' => 'NATIONAL_CODE', ]) ->create();
-
Use
verify()
method<?php use PayStar\Ipg\Facades\PayStarIpg; PayStarIpg::amount('AMOUNT') ->refNum('REF_NUM') ->sign('SIGN') ->verify();
-
Use
payment()
method<?php use PayStar\Ipg\Facades\PayStarIpg; // Redirect to Gateway PayStarIpg::token('TOKEN')->payment();
#️⃣ How to generate sign
<?php use PayStar\Ipg\Facades\Encryption; // The Encryption Facade has 3 methods Encryption::sign($amount, $orderId, $callbackUrl); // Generate a sign with set algorithm in config file Encryption::algos(); // Show list of hash Algorithms (hash_algos() method) Encryption::hash($algo, $string, $key, $binary); // use hash_hmac() method