1. Go to this page and download the library: Download hans-thomas/zarinpal library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Zarinpal\Laravel\Facade\Zarinpal;
$results = Zarinpal::request(
"example.com/call_back", //call back url is ed also
'metadata' => [
'[email protected]', // email is optional
'09000000000', //phone number is optional
]
);
// save $results['authority'] for verifying step
Zarinpal::redirect(); // redirect to zarinpal
// after that verify transaction by that $results['authority']
Zarinpal::verify(1000,$results['authority']);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.