laravel-ipg maintained by paystar
Description
A package for PayStar payment gateway and Those for whom time is important
Author
Last update
2023/07/15 10:12
(dev-main)
License
Downloads
18
Tags
payment - pay - bank - ipg - fast-pay - bank-gateway - iranian-bank - online-pay - fast-payment - pay-star - paystar-ipg
:arrow_down: Installation guide
Install package
composer require paystar/laravel-ipg
Publish configs
php artisan vendor:publish --tag=paystar-ipg
:book: List of available methods
- create(): return a token
- payment(): auto redirect to gateway
- verify(): verify transaction
:heavy_check_mark: 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
Option description name customer name phone customer phone mail customer mail description description of order allotment Share per transaction callback_method - wallet_hashid - national_code national code of customer 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