1. Go to this page and download the library: Download dpsoft/parsian-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/ */
dpsoft / parsian-payment example snippets
use Dpsoft\Parsian\Parsian;
try{
/**
* @param int $pin (mount ( after payment
* @param int $orderId (optional) The unique order id, generate by package if value passed null
* @param int $additionalData (optional) addition data
*
* @method payRequest Return array contain transaction `token` and `orderId` and you cat save.
* $token = $response['token'];
* $orderId = $response['orderId'];
*
*/
$response = $parsian->request($amount, $callbackUrl, $orderId, $additionalData);
/**
* Redirect user to payment gateway
*/
echo $parsian->redirect();
/**
* If you need to get payment url for application or another reason you can use this method
*
* $paymentUrl = $parsian->getPaymentUrl();
*
*/
}catch (\Throwable $exception){
echo $exception->getMessage();
}