amirmehr / mehr-gate
easy gate connection with test mode for zarinpal.com
0.1
2022-02-16 06:47 UTC
README
This package is developed by Amir Hosein Sharifi Mehr for 'https://zarinpal.com' amirhoseinsharifimehr@gmail.com
Installation
composer require amirmehr/mehr-gate
Put current line to 'providers' in config/app.php
Amirmehr\MehrGate\MehrGateServiceProvider::class
Put current line to 'aliases' in config/app.php
'MehrGate' =>Amirmehr\MehrGate\MehrGateFacade::class
Usage
.env variables
MEHR_GATE_CALLBACK=http://localhost/public/verify MEHR_GATE_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx MEHR_GATE_TEST=true
Init request to gate
$result_gate = MehrGate::request( 2000, 'توضیحات', '09185001010' ); if ( isset( $result_gate["Status"] ) && $result_gate["Status"] == 100 ) { $result_gate["Authority"]; $result_gate["StartPay"]; } else { $result_gate["Status"]; $result_gate["Message"]; }
Authority (Token) & StartPay must save in DB
License
The MehrGate is open source licensed under the MIT license.