Plugin Directory

Changeset 1924027


Ignore:
Timestamp:
08/13/2018 11:21:54 AM (8 years ago)
Author:
ham3da
Message:

پس از به روز رسانی به دلیل تغییر شناسه درگاه، لطفاً مجدداً درگاه را در بخش پیکربندی فعال نمایید.

Location:
bank-melli-edd-gateway
Files:
17 added
2 edited

Legend:

Unmodified
Added
Removed
  • bank-melli-edd-gateway/trunk/Melli_for_EDD.php

    r1923953 r1924027  
    11<?php
     2
    23/*
    3     Plugin Name: Bank Melli Iran EDD gateway
    4     Version: 1.5.1
    5     Description:  Sadad payment gateway for Easy digital downloads(switch: 1).
    6     Plugin URI: http://ham3da.ir/
    7     Author: Javad Ahshamian
    8     Author URI: https://ham3da.ir/
    9     License: GPLv2
    10     Tested up to: 4.9.4
    11     Text Domain: ex_lang
    12     Domain Path: /lang
     4  Plugin Name: Bank Melli Iran EDD gateway
     5  Version: 1.5.2
     6  Description:  Sadad payment gateway for Easy digital downloads(switch: 1).
     7  Plugin URI: http://ham3da.ir/
     8  Author: Javad Ahshamian
     9  Author URI: https://ham3da.ir/
     10  License: GPLv2
     11  Tested up to: 4.9.4
     12  Text Domain: ex_lang
     13  Domain Path: /lang
    1314 */
    14  
    15 if (!defined('ABSPATH') ) {
    16     die("Access Denied");
     15
     16if (!defined('ABSPATH'))
     17{
     18    die("Access Denied");
    1719}
    1820
     
    2527
    2628add_action('admin_menu', 'bmi_setMenu');
    27    
    28 function bmi_setMenu(  )
    29 {
    30 
    31     add_menu_page(__('Sadad for EDD', 'ex_lang'), __('Sadad for EDD', 'ex_lang'), 'activate_plugins', "melli_bank_gate", 'bmi_load_inteface', plugin_dir_url( __FILE__ ).'/images/icon.png');
    32     add_submenu_page("melli_bank_gate", __('About', 'ex_lang'), __('About', 'ex_lang'), 'activate_plugins', "melli_bank_gate_about", "bmi_load_about");
    33     add_submenu_page("melli_bank_gate", __('Newsletters', 'ex_lang'), __('Newsletters', 'ex_lang'), 'activate_plugins', "melli_bank_gate_news", "bmi_load_news");
    34 
    35 }
    36 
    37 function bmi_load_inteface(  )
    38 {
    39     include dirname(__file__)."/melli.php";
    40 }
    41 function bmi_load_about(  )
    42 {
    43     include dirname(__file__)."/about.php";
    44 }
    45 function bmi_load_news(  )
    46 {
    47     include dirname(__file__)."/news.php";
     29
     30function bmi_setMenu()
     31{
     32
     33    add_menu_page(__('Sadad for EDD', 'ex_lang'), __('Sadad for EDD', 'ex_lang'), 'activate_plugins', "melli_bank_gate", 'bmi_load_inteface', plugin_dir_url(__FILE__) . '/images/icon.png');
     34    add_submenu_page("melli_bank_gate", __('About', 'ex_lang'), __('About', 'ex_lang'), 'activate_plugins', "melli_bank_gate_about", "bmi_load_about");
     35    add_submenu_page("melli_bank_gate", __('Newsletters', 'ex_lang'), __('Newsletters', 'ex_lang'), 'activate_plugins', "melli_bank_gate_news", "bmi_load_news");
     36}
     37
     38function bmi_load_inteface()
     39{
     40    include dirname(__file__) . "/melli.php";
     41}
     42
     43function bmi_load_about()
     44{
     45    include dirname(__file__) . "/about.php";
     46}
     47
     48function bmi_load_news()
     49{
     50    include dirname(__file__) . "/news.php";
    4851}
    4952
    5053/////------------------------------------------------
    51 function edd_bmi_rial ($formatted, $currency, $price) {
    52 
    53     return $price . __(' Rial', 'ex_lang');
    54 }
    55 add_filter( 'edd_rial_currency_filter_after', 'edd_bmi_rial', 10, 3 );
     54function edd_bmi_rial($formatted, $currency, $price)
     55{
     56
     57    return $price . __(' Rial', 'ex_lang');
     58}
     59
     60add_filter('edd_rial_currency_filter_after', 'edd_bmi_rial', 10, 3);
     61
    5662/////------------------------------------------------
    57 function bmi_add_gateway($gateways)
    58 {
    59     $gateways['melli_gate'] = array('admin_label' => __('Sadad Payment Gateway', 'ex_lang'), 'checkout_label' => __('Sadad Payment Gateway', 'ex_lang'));
    60     return $gateways;
    61 }
    62 add_filter( 'edd_payment_gateways', 'bmi_add_gateway' );
    63 
    64 function bmi_cc_form ()
    65 {
    66     do_action( 'bmi_cc_form_action' );
    67 }
    68 add_filter( 'edd_melli_gate_cc_form', 'bmi_cc_form' );
    69 
     63function bmi_add_gateway($gateways)
     64{
     65    $gateways['melli_gate'] = array('admin_label' => __('Sadad Payment Gateway', 'ex_lang'), 'checkout_label' => __('Sadad Payment Gateway', 'ex_lang'));
     66    return $gateways;
     67}
     68
     69add_filter('edd_payment_gateways', 'bmi_add_gateway');
     70
     71function bmi_cc_form()
     72{
     73    do_action('bmi_cc_form_action');
     74}
     75
     76add_filter('edd_melli_gate_cc_form', 'bmi_cc_form');
    7077/////-------------------------------------------------
    71 function bmi_process_payment($purchase_data)
    72 {
    73     //error_reporting(0);
    74 @session_start();
    75 $site_title = get_bloginfo( 'name' );
    76 $request_form1 = '<html dir=rtl>
     78function bmi_process_payment($purchase_data)
     79{
     80    $site_title = get_bloginfo('name');
     81    $request_form1 = '<html dir=rtl>
    7782<head>
    7883<meta http-equiv="Content-Language" content="fa">
     
    8489<font color="black" size=4 px>
    8590        <p/>
    86         <br/>'.__('Connecting to the payment Gateway...', 'ex_lang').'<br>
    87         <br/>'.__('Please wait...', 'ex_lang') .'<br>
     91        <br/>' . __('Connecting to the payment Gateway...', 'ex_lang') . '<br>
     92        <br/>' . __('Please wait...', 'ex_lang') . '<br>
    8893&nbsp;</font></div>
    8994</center>';
    90         global $edd_options;
    91 
    92         $client = new SoapClient('https://sadad.shaparak.ir/services/MerchantUtility.asmx?wsdl');
    93        
    94                 if ($client->fault)
    95                 {
    96                     edd_set_error( 'pay_00', __('An error occurred while connecting to the payment gateway[code: 00].', 'ex_lang') );
    97                     edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
    98                     exit();
    99                 }
    100 
    101    
    102 
    103     $payment_data = array(
    104         'price' => $purchase_data['price'],
    105         'date' => $purchase_data['date'],
    106         'user_email' => $purchase_data['post_data']['edd_email'],
    107         'purchase_key' => $purchase_data['purchase_key'],
    108         'currency' => $edd_options['currency'],
    109         'downloads' => $purchase_data['downloads'],
    110         'cart_details' => $purchase_data['cart_details'],
    111         'user_info' => $purchase_data['user_info'],
    112         'status' => 'pending');
    113     $payment = edd_insert_payment($payment_data);
    114    
    115    
    116     $Melli_MerchantID = $edd_options['Melli_MerchantID'];
    117     $Melli_Terminal_ID = $edd_options['Melli_Terminal_ID'];
    118     $Melli_Password = $edd_options['Melli_Password'];
    119    
    120     if ($payment)
     95    global $edd_options;
     96
     97    $client = new SoapClient('https://sadad.shaparak.ir/services/MerchantUtility.asmx?wsdl');
     98
     99    if ($client->fault)
    121100    {
    122         $_SESSION['bmi_payment_data'] = $payment_data;
    123        
    124         $_SESSION['Melli_payment'] = $payment;
    125         $orderId = date('ym').date('His').$payment;
    126         $return = add_query_arg(array('gate'=> 'melli_gate', 'orderId'=>$orderId), get_permalink($edd_options['success_page']));
    127         $amount = $purchase_data['price'];
    128         $localDate = date("Ymd");
    129         $localTime = date("His");
    130         $additionalData = "Purchase key: ".$purchase_data['purchase_key'];
     101        edd_set_error('pay_00', __('An error occurred while connecting to the payment gateway[code: 00].', 'ex_lang'));
     102        edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
     103        exit();
     104    }
     105
     106
     107
     108    $payment_data = array(
     109        'price' => $purchase_data['price'],
     110        'date' => $purchase_data['date'],
     111        'user_email' => $purchase_data['post_data']['edd_email'],
     112        'purchase_key' => $purchase_data['purchase_key'],
     113        'currency' => $edd_options['currency'],
     114        'downloads' => $purchase_data['downloads'],
     115        'cart_details' => $purchase_data['cart_details'],
     116        'user_info' => $purchase_data['user_info'],
     117        'status' => 'pending');
     118    $payment_id = edd_insert_payment($payment_data);
     119
     120    $Melli_MerchantID = $edd_options['Melli_MerchantID'];
     121    $Melli_Terminal_ID = $edd_options['Melli_Terminal_ID'];
     122    $Melli_Password = $edd_options['Melli_Password'];
     123
     124    if ($payment_id)
     125    {
     126        $orderId = time();
     127        $return = add_query_arg(array('gate' => 'melli_gate', 'pid' => $payment_id, 'orderId' => $orderId), get_permalink($edd_options['success_page']));
     128        $amount = $purchase_data['price'];
     129        $localDate = date("Ymd");
     130        $localTime = date("His");
     131        $additionalData = "Purchase key: " . $purchase_data['purchase_key'];
    131132
    132133/////////////////PAY REQUEST PART/////////////////////////
    133         // Call the SOAP method
    134 
    135         $PayResult = $client->PaymentUtility($Melli_MerchantID, $amount, $orderId, $Melli_Password, $Melli_Terminal_ID, $return);
    136        
     134        // Call the SOAP method
     135
     136        $PayResult = $client->PaymentUtility($Melli_MerchantID, $amount, $orderId, $Melli_Password, $Melli_Terminal_ID, $return);
     137
    137138///************END of PAY REQUEST***************///
    138139// Successfull Pay Request
    139           if(is_array($PayResult))
    140           { 
    141                    $_SESSION['req'] = $PayResult['RequestKey'];
    142                    $FormStr = $PayResult['PaymentUtilityResult'];
    143                    //var_dump($PayResult);
    144                    die($request_form1.$FormStr.
    145                           '<script type="text/javascript">
     140        if (is_array($PayResult))
     141        {
     142            edd_update_payment_meta($payment_id, 'RequestKey', $PayResult['RequestKey']);
     143            $FormStr = $PayResult['PaymentUtilityResult'];
     144            //var_dump($PayResult);
     145            die($request_form1 . $FormStr .
     146                    '<script type="text/javascript">
    146147                          document.getElementById("paymentUTLfrm").submit();
    147148                          </script></form></body></html>');
    148           }
    149           else
    150           {
    151            
    152             edd_update_payment_status($payment, 'failed');
    153             edd_insert_payment_note( $payment, __('Error connecting to payment gateway.[code: 02]', 'ex_lang'));
    154             edd_set_error( 'pay_02', __('Error connecting to payment gateway.[code: 02]', 'ex_lang'));
    155             edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
    156           }               
    157        
    158     }
     149        }
     150        else
     151        {
     152
     153            edd_update_payment_status($payment_id, 'failed');
     154            edd_insert_payment_note($payment_id, __('Error connecting to payment gateway.[code: 02]', 'ex_lang'));
     155            edd_set_error('pay_02', __('Error connecting to payment gateway.[code: 02]', 'ex_lang'));
     156            edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
     157        }
     158    }
    159159    else
    160160    {
    161         edd_set_error( 'pay_01', __('Error creating payment, please try again' , 'ex_lang'));
    162         edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
    163     }
    164 }
     161        edd_set_error('pay_01', __('Error creating payment, please try again', 'ex_lang'));
     162        edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
     163    }
     164}
     165
    165166add_action('edd_gateway_melli_gate', 'bmi_process_payment');
    166167
     
    168169function bmi_verify()
    169170{
    170     @session_start();
    171     //error_reporting(0);
    172     global $edd_options;
    173      
    174     $Melli_MerchantID = $edd_options['Melli_MerchantID'];
    175     $Melli_Terminal_ID = $edd_options['Melli_Terminal_ID'];
    176     $Melli_Password = $edd_options['Melli_Password'];
    177 
    178    
    179     if (isset($_GET['order']) && $_GET['gate'] == 'melli_gate' && $_SESSION['Melli_payment'] == substr($_GET["orderId"], 10))
     171    //error_reporting(0);
     172    global $edd_options;
     173
     174    $Melli_MerchantID = $edd_options['Melli_MerchantID'];
     175    $Melli_Terminal_ID = $edd_options['Melli_Terminal_ID'];
     176    $Melli_Password = $edd_options['Melli_Password'];
     177
     178
     179    if (isset($_GET['gate']) && $_GET['gate'] == 'melli_gate' && isset($_GET["orderId"]) && isset($_GET["pid"]))
    180180    {
    181           $payment = $_SESSION['Melli_payment'];
    182           $res_id = $_GET["orderId"]; //orderid
    183          
    184         $do_inquiry = false;
    185         $do_settle = false;
    186         $do_reversal = false;
    187         $do_publish = false;
     181        //$payment = $_SESSION['Melli_payment'];
     182        $res_id = intval($_GET["orderId"]); //orderid
     183        $payment_id = intval($_GET["pid"]); //payment_id
    188184       
     185        $do_inquiry = false;
     186        $do_settle = false;
     187        $do_reversal = false;
     188        $do_publish = false;
    189189       
    190        
    191         //Connect to WebService
    192 
    193                 $client = new SoapClient('https://sadad.shaparak.ir/services/MerchantUtility.asmx?wsdl');
    194                 if ($client->fault)
    195                 {
    196                     edd_set_error( 'ver_03',  __('Transaction unsuccessful. if the amount of your bank account has been reduced. Until the end of today, your account will be refunded[code: 03].', 'ex_lang'));
    197                     edd_update_payment_status($_SESSION['Melli_payment'], 'failed');
    198                     edd_insert_payment_note( $_SESSION['Melli_payment'], __('Error in Bank Verification[code: 03]' , 'ex_lang'));
    199                     edd_send_back_to_checkout('?payment-mode=melli_gate');
    200                
    201                 }
     190        $RequestKey = edd_get_payment_meta($payment_id, 'RequestKey', true);
     191
     192
     193        //Connect to WebService
     194
     195        $client = new SoapClient('https://sadad.shaparak.ir/services/MerchantUtility.asmx?wsdl');
     196        if ($client->fault)
     197        {
     198            edd_set_error('ver_03', __('Transaction unsuccessful. if the amount of your bank account has been reduced. Until the end of today, your account will be refunded[code: 03].', 'ex_lang'));
     199            edd_update_payment_status($payment_id, 'failed');
     200            edd_insert_payment_note($payment_id, __('Error in Bank Verification[code: 03]', 'ex_lang'));
     201            edd_send_back_to_checkout('?payment-mode=melli_gate');
     202        }
    202203//////////////////VERIFY REQUEST///////////////////////
    203         if (!edd_is_test_mode())
    204         {
    205             // Call the SOAP method
    206             $payment_data = $_SESSION['bmi_payment_data'];
    207             $price = $payment_data['price'];
     204        if (!edd_is_test_mode())
     205        {
     206            // Call the SOAP method
     207            $payment_data = new EDD_Payment($payment_id);
     208            $price = $payment_data->total;
     209             
     210            $result = $client->CheckRequestStatusResult($res_id, $Melli_MerchantID, $Melli_Terminal_ID, $Melli_Password, $RequestKey, $price);
     211            $array = get_object_vars($result);
    208212           
    209             $result = $client->CheckRequestStatusResult($res_id , $Melli_MerchantID, $Melli_Terminal_ID, $Melli_Password, $_SESSION['req'], $price);
    210             $array = get_object_vars($result);
    211213            $err_msg = bmi_CheckStatus($array['FailCode']);
    212            
     214
    213215            $ResponseCode = $array['ResponseCode'];
    214216            $RefNo = $array['RefrenceNumber'];
    215217            $AppStatusDescription = $array['AppStatusDescription'];
    216218            $AppStatusCode = $array['AppStatusCode'];
    217                     if($AppStatusCode == 0 && $AppStatusDescription == "COMMIT")
    218                     {
    219                         $TraceNo = $array['TraceNo'];
    220                         //واریز شد
    221                         $do_reversal = false;
    222                         $do_publish = true;
    223                    
    224                     }
    225                     else
    226                     {
    227                         $do_reversal = true;
    228                         $do_publish = false;
    229                     }
    230                      
    231         }
    232         else
    233         {
    234             //in test mode
    235             $do_reversal = true;
    236             $do_publish = false;
    237         }
     219           
     220                $do_reversal = false;
     221                $do_publish = true;
     222               
     223            if (intval($AppStatusCode) == 0 && $AppStatusDescription == "COMMIT")
     224            {
     225                $TraceNo = $array['TraceNo'];
     226                //واریز شد
     227                $do_reversal = false;
     228                $do_publish = true;
     229            }
     230            else
     231            {
     232                $do_reversal = true;
     233                $do_publish = false;
     234            }
     235        }
     236        else
     237        {
     238            //in test mode
     239            $do_reversal = true;
     240            $do_publish = false;
     241        }
    238242///*************************END of VERIFY REQUEST**///
    239 
    240243//////////////////REVERSAL REQUEST////////////////////
    241         if ($do_reversal == true)
    242         {
    243 
    244                 edd_set_error( 'rev_04', __('Transaction unsuccessful. if the amount of your bank account has been reduced. Until the end of today, your account will be refunded[code: 04].', 'ex_lang'));
    245                 edd_update_payment_status($_SESSION['Melli_payment'], 'failed');
    246                 edd_insert_payment_note( $_SESSION['Melli_payment'], 'R04:'.'<pre>'.$err_msg.'</pre>' );
    247                 edd_send_back_to_checkout('?payment-mode=melli_gate');
    248         }
    249             #echo $soapclient->debug_str;
     244        if ($do_reversal == true)
     245        {
     246
     247            edd_set_error('rev_04', __('Transaction unsuccessful. if the amount of your bank account has been reduced. Until the end of today, your account will be refunded[code: 04].', 'ex_lang'));
     248            edd_update_payment_status($payment_id, 'failed');
     249            edd_insert_payment_note($payment_id, 'R04:' . '<pre>' . $err_msg . '</pre>');
     250            edd_send_back_to_checkout('?payment-mode=melli_gate');
     251        }
     252        #echo $soapclient->debug_str;
    250253///***************END of REVERSAL REQUEST*******************///
    251         if ($do_publish == true)
    252         {
    253             // Publish Payment
    254             $_SESSION['bmi_TraceNo'] = $TraceNo;
    255             $do_publish = false;
    256             edd_update_payment_status($payment, 'publish');
    257             edd_insert_payment_note( $payment, __('Transaction Number:', 'ex_lang').$TraceNo);
    258             //echo "<script type='text/javascript'>alert('کد تراکنش خرید بانک : ".$TraceNo."');</script>";
    259         }
    260     }   
    261 }
     254        if ($do_publish == true)
     255        {
     256            // Publish Payment
     257            $do_publish = false;
     258            edd_update_payment_status($payment_id, 'publish');
     259            edd_insert_payment_note($payment_id, __('Transaction Number:', 'ex_lang') . $TraceNo);
     260            //echo "<script type='text/javascript'>alert('کد تراکنش خرید بانک : ".$TraceNo."');</script>";
     261        }
     262    }
     263}
     264
    262265add_action('init', 'bmi_verify');
     266
    263267/////-----------------------------------------------
    264 function bmi_add_settings ($settings) {
    265     $Melli_settings = array (
    266         array (
    267             'id'        =>  'Melli_settings',
    268             'name'      =>  __('<b>Sadad Gateway Settings</b><br>Do not complete in the test mode', 'ex_lang'),
    269             'desc'      =>  '',
    270             'type'      =>  'header'
    271         ),
    272         array (
    273             'id'        =>  'Melli_MerchantID',
    274             'name'      =>  __('Merchant ID', 'ex_lang'),//شماره پذیرنده
    275             'desc'      =>  '',
    276             'type'      =>  'text',
    277             'size'      =>  'medium'
    278         ),
    279         array (
    280             'id'        =>  'Melli_Terminal_ID',
    281             'name'      =>  __('Terminal ID', 'ex_lang'),//شماره ترمینال
    282             'desc'      =>  '',
    283             'type'      =>  'text',
    284             'size'      =>  'medium'
    285         ),
    286         array (
    287             'id'        =>  'Melli_Password',
    288             'name'      =>  __('Password', 'ex_lang'),//رمز
    289             'desc'      =>  '',
    290             'type'      =>  'text',
    291             'size'      =>  'medium'
    292         )
    293     );
    294     return array_merge( $settings, $Melli_settings );
    295 }
     268function bmi_add_settings($settings)
     269{
     270    $Melli_settings = array(
     271        array(
     272            'id' => 'Melli_settings',
     273            'name' => __('<b>Sadad Gateway Settings</b><br>Do not complete in the test mode', 'ex_lang'),
     274            'desc' => '',
     275            'type' => 'header'
     276        ),
     277        array(
     278            'id' => 'Melli_MerchantID',
     279            'name' => __('Merchant ID', 'ex_lang'), //شماره پذیرنده
     280            'desc' => '',
     281            'type' => 'text',
     282            'size' => 'medium'
     283        ),
     284        array(
     285            'id' => 'Melli_Terminal_ID',
     286            'name' => __('Terminal ID', 'ex_lang'), //شماره ترمینال
     287            'desc' => '',
     288            'type' => 'text',
     289            'size' => 'medium'
     290        ),
     291        array(
     292            'id' => 'Melli_Password',
     293            'name' => __('Password', 'ex_lang'), //رمز
     294            'desc' => '',
     295            'type' => 'text',
     296            'size' => 'medium'
     297        )
     298    );
     299    return array_merge($settings, $Melli_settings);
     300}
     301
    296302add_filter('edd_settings_gateways', 'bmi_add_settings');
     303
    297304/////-------------------------------------------------
    298 function bmi_CheckStatus($ErrorCode) {
    299     $tmess="شرح خطا: ";
    300 $ErrorDesc =  $ErrorCode;
    301     if($ErrorCode=="0")
    302         $ErrorDesc = "بدون اشكال";
    303     if($ErrorCode=="1")
    304         $ErrorDesc = "با بانک ملی تماس حا صل نمایید";
    305     else if($ErrorCode=="12")
    306         $ErrorDesc = "تراکنش معتبر نمی باشد";
    307     else if($ErrorCode=="13")
    308         $ErrorDesc = "مبلغ تراکنش معتبر نمی باشد";
    309     else if($ErrorCode=="30")
    310         $ErrorDesc = "فرمت پيام دچار اشكال مي باشد";
    311     else if($ErrorCode=="33")
    312         $ErrorDesc = "تاریخ استفاده کارت به پایان رسیده است";
    313     else if($ErrorCode=="41")
    314         $ErrorDesc = "كارت مفقود مي باشد";
    315     else if($ErrorCode=="43")
    316         $ErrorDesc = "كارت مسروقه است";
    317     else if($ErrorCode=="51")
    318         $ErrorDesc = "موجودي حساب كافي نمي باشد";
    319     else if($ErrorCode=="55")
    320         $ErrorDesc = "رمز وارده صحيح نمي باشد";
    321     else if($ErrorCode=="56")
    322         $ErrorDesc = "شماره کارت یا CVV2  صحیح نمی باشد ";
    323     else if($ErrorCode=="57")
    324         $ErrorDesc = "دارنده کارت مجاز به انجام این تراکنش نمی باشد";
    325     else if($ErrorCode=="58")
    326         $ErrorDesc = "پذیرنده کارت مجاز به انجام این تراکنش نمی باشد";
    327     else if($ErrorCode=="61")
    328         $ErrorDesc = "مبلغ تراکنش از حد مجاز بالاتر است";
    329     else if($ErrorCode=="65")
    330         $ErrorDesc = "تعداد دفعات تراکنش از حد مجاز بیشتر است";
    331     else if($ErrorCode=="75")
    332         $ErrorDesc = "ورود رمز دوم از حد مجاز گذشته است. رمز دوم جدید در خواست نمایید";     
    333     else if($ErrorCode=="79")
    334         $ErrorDesc = "شماره حساب نامعتبر است";
    335     else if($ErrorCode=="80")
    336         $ErrorDesc = "تراكنش موفق عمل نكرده است";
    337     else if($ErrorCode=="84")
    338         $ErrorDesc = "سوئيچ صادركننده فعال نيست";
    339     else if($ErrorCode=="88")
    340         $ErrorDesc = "سيستم دچار اشكال شده است";
    341     else if($ErrorCode=="90")
    342         $ErrorDesc = "ارتباط به طور موقت قطع می باشد";
    343     else if($ErrorCode=="91")
    344         $ErrorDesc = "پاسخ در زمان تعیین شده بدست سیستم نرسیده است";
    345     else if($ErrorCode=="-1")
    346         $ErrorDesc = "یکی از موارد مبلغ، شماره سفارش یا کلید اشتباه است";
    347     else if($ErrorCode=="1003")
    348         $ErrorDesc = "اطلاعات پذیرنده اشتباه است";
    349     else if($ErrorCode=="1004")
    350         $ErrorDesc = "پذیرنده موجود نیست";
    351     else if($ErrorCode=="1006")
    352         $ErrorDesc = "خطای داخلی";
    353     else if($ErrorCode=="1012")
    354         $ErrorDesc = "اطلاعات پذیرنده اشتباه است";
    355     else if($ErrorCode=="1017")
    356         $ErrorDesc = "پاسخ خطا از سمت مرکز";
    357     else if($ErrorCode=="1018")
    358         $ErrorDesc = "شماره کارت اشتباه است";
    359     else if($ErrorCode=="1019")
    360         $ErrorDesc = "مبلغ بیش از حد مجاز است";
    361     else if($ErrorCode=="9005")
    362         $ErrorDesc = "تراکنش ناموفق ( مبلغ به حساب دارنده کارت برگشت داده شده است)";
    363     else if($ErrorCode=="9006")
    364         $ErrorDesc = "تراکنش ناتمام ( در صورت کسرموجودی مبلغ به حساب دارنده کارت برگشت داده می شود)";
    365     return $tmess.$ErrorDesc;
    366 }
     305function bmi_CheckStatus($ErrorCode)
     306{
     307    $tmess = "شرح خطا: ";
     308    $ErrorDesc = $ErrorCode;
     309    if ($ErrorCode == "0")
     310        $ErrorDesc = "بدون اشكال";
     311    if ($ErrorCode == "1")
     312        $ErrorDesc = "با بانک ملی تماس حا صل نمایید";
     313    else if ($ErrorCode == "12")
     314        $ErrorDesc = "تراکنش معتبر نمی باشد";
     315    else if ($ErrorCode == "13")
     316        $ErrorDesc = "مبلغ تراکنش معتبر نمی باشد";
     317    else if ($ErrorCode == "30")
     318        $ErrorDesc = "فرمت پيام دچار اشكال مي باشد";
     319    else if ($ErrorCode == "33")
     320        $ErrorDesc = "تاریخ استفاده کارت به پایان رسیده است";
     321    else if ($ErrorCode == "41")
     322        $ErrorDesc = "كارت مفقود مي باشد";
     323    else if ($ErrorCode == "43")
     324        $ErrorDesc = "كارت مسروقه است";
     325    else if ($ErrorCode == "51")
     326        $ErrorDesc = "موجودي حساب كافي نمي باشد";
     327    else if ($ErrorCode == "55")
     328        $ErrorDesc = "رمز وارده صحيح نمي باشد";
     329    else if ($ErrorCode == "56")
     330        $ErrorDesc = "شماره کارت یا CVV2  صحیح نمی باشد ";
     331    else if ($ErrorCode == "57")
     332        $ErrorDesc = "دارنده کارت مجاز به انجام این تراکنش نمی باشد";
     333    else if ($ErrorCode == "58")
     334        $ErrorDesc = "پذیرنده کارت مجاز به انجام این تراکنش نمی باشد";
     335    else if ($ErrorCode == "61")
     336        $ErrorDesc = "مبلغ تراکنش از حد مجاز بالاتر است";
     337    else if ($ErrorCode == "65")
     338        $ErrorDesc = "تعداد دفعات تراکنش از حد مجاز بیشتر است";
     339    else if ($ErrorCode == "75")
     340        $ErrorDesc = "ورود رمز دوم از حد مجاز گذشته است. رمز دوم جدید در خواست نمایید";
     341    else if ($ErrorCode == "79")
     342        $ErrorDesc = "شماره حساب نامعتبر است";
     343    else if ($ErrorCode == "80")
     344        $ErrorDesc = "تراكنش موفق عمل نكرده است";
     345    else if ($ErrorCode == "84")
     346        $ErrorDesc = "سوئيچ صادركننده فعال نيست";
     347    else if ($ErrorCode == "88")
     348        $ErrorDesc = "سيستم دچار اشكال شده است";
     349    else if ($ErrorCode == "90")
     350        $ErrorDesc = "ارتباط به طور موقت قطع می باشد";
     351    else if ($ErrorCode == "91")
     352        $ErrorDesc = "پاسخ در زمان تعیین شده بدست سیستم نرسیده است";
     353    else if ($ErrorCode == "-1")
     354        $ErrorDesc = "یکی از موارد مبلغ، شماره سفارش یا کلید اشتباه است";
     355    else if ($ErrorCode == "1003")
     356        $ErrorDesc = "اطلاعات پذیرنده اشتباه است";
     357    else if ($ErrorCode == "1004")
     358        $ErrorDesc = "پذیرنده موجود نیست";
     359    else if ($ErrorCode == "1006")
     360        $ErrorDesc = "خطای داخلی";
     361    else if ($ErrorCode == "1012")
     362        $ErrorDesc = "اطلاعات پذیرنده اشتباه است";
     363    else if ($ErrorCode == "1017")
     364        $ErrorDesc = "پاسخ خطا از سمت مرکز";
     365    else if ($ErrorCode == "1018")
     366        $ErrorDesc = "شماره کارت اشتباه است";
     367    else if ($ErrorCode == "1019")
     368        $ErrorDesc = "مبلغ بیش از حد مجاز است";
     369    else if ($ErrorCode == "9005")
     370        $ErrorDesc = "تراکنش ناموفق ( مبلغ به حساب دارنده کارت برگشت داده شده است)";
     371    else if ($ErrorCode == "9006")
     372        $ErrorDesc = "تراکنش ناتمام ( در صورت کسرموجودی مبلغ به حساب دارنده کارت برگشت داده می شود)";
     373    return $tmess . $ErrorDesc;
     374}
  • bank-melli-edd-gateway/trunk/readme.txt

    r1923953 r1924027  
    4040
    4141== Upgrade Notice ==
     42= 1.5.2 =
     43* به دلیل تغییر شناسه درگاه لطفاً مجدداً درگاه را در بخش پیکربندی فعال نمایید.
     44* Minor Change | تغییرات جزیی
    4245= 1.5.1 =
    4346* به دلیل تغییر شناسه درگاه لطفاً مجدداً درگاه را در بخش پیکربندی فعال نمایید.
     
    5861* Fix bug
    5962
     63== Changelog ==
     64= 1.5.2 =
     65* fix bug
     66= 1.5.1 =
     67* Minor Change
    6068== Changelog ==
    6169= 1.5 =
Note: See TracChangeset for help on using the changeset viewer.