1. Go to this page and download the library: Download nimah79/iran-payment 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 Dena\IranPayment\IranPayment;
// Default gateway
$payment = IranPayment::create();
// Select one of available gateways
$payment = IranPayment::create('sadad');
// Test gateway (Would not work on production environment)
$payment = IranPayment::create('test');
// Or use your own gateway
$payment = IranPayment::create(NewGateway::class);
$payment->setUserId($user->id)
->setAmount($data['amount'])
->setCallbackUrl(route('bank.callback'))
->ready();
return $payment->redirect();