PHP code example of meysam-znd / iran-gateways

1. Go to this page and download the library: Download meysam-znd/iran-gateways 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/ */

    

meysam-znd / iran-gateways example snippets

bash
php artisan vendor:publish --provider="MeysamZnd\IranGateways\ServiceProvider"
bash
/**
 * @param intiger $terminal : آی دی ترمینال بانک ملت
 * @param string $username : نام کاربری بانک ملت
 * @param string $password : رمز عبور بانک ملت
 */
$mellat = new MellatBank($terminal, $username, $password);
bash
/**
 * @param  $amount : مبلغ پرداخت
 * @param  $callBackUrl : آدرس برگشت بعد از پرداخت
 * @param $orderId : شماره فاکتور
 */
$mellat->payment($amount, $orderId, $callBackUrl);
bash

$results = $mellat->controlPayment($_POST);
if (!($results && $results['status'] === 'success')) {
        dd($results);
   }
dd($results['trans');