Plugin Directory

Changeset 1834018


Ignore:
Timestamp:
03/05/2018 09:45:34 PM (8 years ago)
Author:
ham3da
Message:

بهینه‌سازی افزونه

Location:
bank-melli-edd-gateway
Files:
102 added
1 deleted
3 edited

Legend:

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

    r1576697 r1834018  
    11<?php
    2 /**
     2/*
    33    Plugin Name: Bank Melli Iran EDD gateway
    4     Version: 1.4
    5     Description:  این افزونه درگاه بانک ملی و شبکه پرداخت الکترونیک شاپرک را به افزونه فروش فایل EDD اضافه می‌کند.
     4    Version: 1.4.1
     5    Description:  Sadad payment gateway for Easy digital downloads(switch: 1).
    66    Plugin URI: http://ham3da.ir/
    77    Author: Javad Ahshamian
    8     Author URI: http://ham3da.ir/
     8    Author URI: https://ham3da.ir/
    99    License: GPLv2
    10     Tested up to: 4.5
    11 **/
     10    Tested up to: 4.9.4
     11    Text Domain: ex_lang
     12    Domain Path: /lang
     13 */
     14
     15
     16add_action('plugins_loaded', 'edd_sadad1_load_textdomain');
     17
     18function edd_sadad1_load_textdomain()
     19{
     20    load_plugin_textdomain('ex_lang', false, basename(dirname(__FILE__)) . '/lang');
     21}
     22
    1223
    1324include "menu_setup.php";
     
    1526
    1627if (!defined('ABSPATH') ) {
    17     echo "HAM3DA";
    18     exit;
    19 }
    20 
    21 if(class_exists("nusoap_base")== false)
    22 {
    23     require_once('lib/nusoap.php');
    24 }
    25 
    26 @session_start();
     28    die("Access Denied");
     29}
     30
     31
    2732/////------------------------------------------------
    2833function edd_bmi_rial ($formatted, $currency, $price) {
    2934
    30     return $price . ' ریال';
     35    return $price . __(' Rial', 'ex_lang');
    3136}
    3237add_filter( 'edd_rial_currency_filter_after', 'edd_bmi_rial', 10, 3 );
    3338/////------------------------------------------------
    3439function bmi_add_gateway($gateways) {
    35     $gateways['Melli'] = array('admin_label' => 'درگاه بانک ملی ایران', 'checkout_label' => 'بانک ملی ایران');
     40    $gateways['Melli'] = array('admin_label' => __('Sadad Payment Gateway', 'ex_lang'), 'checkout_label' => __('Sadad Payment Gateway', 'ex_lang'));
    3641    return $gateways;
    3742}
     
    4752{
    4853    //error_reporting(0);
     54@session_start();
    4955$site_title = get_bloginfo( 'name' );
    5056$request_form1 = '<html dir=rtl>
     
    5258<meta http-equiv="Content-Language" content="fa">
    5359<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    54 <title>'.$site_title.'</title>
     60<title>' . $site_title . '</title>
    5561</head>
    56 <body>
    57 <center>
    58 <div  style= "border: 1px solid #CCC;font-family:Tahoma;font-size: 12; background-color:#fafafa; width:480px;">
     62<body><center>
     63<div  style= "border: 1px solid #CCC;font-family:Tahoma;font-size: 12; background-color:#fafafa; width:98%;">
    5964<font color="black" size=4 px>
    6065        <p/>
    61         <br/>در حال انتقال به درگاه بانکی ...<br>
    62         <br/>لطفاً صبور باشید ...<br>
     66        <br/>'.__('Connecting to the payment Gateway...', 'ex_lang').'<br>
     67        <br/>'.__('Please wait...', 'ex_lang') .'<br>
    6368&nbsp;</font></div>
    6469</center>';
     
    6974                if ($client->fault)
    7075                {
    71                     edd_set_error( 'pay_00', 'P00:خطایی در اتصال پیش آمد،مجدد تلاش کنید...' );
     76                    edd_set_error( 'pay_00', __('An error occurred while connecting to the payment gateway[code: 00].', 'ex_lang') );
    7277                    edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
    7378                    exit();
     
    110115        $PayResult = $client->PaymentUtility($Melli_MerchantID, $amount, $orderId, $Melli_Password, $Melli_Terminal_ID, $return);
    111116       
    112 
    113117///************END of PAY REQUEST***************///
    114118// Successfull Pay Request
     
    117121                   $_SESSION['req'] = $PayResult['RequestKey'];
    118122                   $FormStr = $PayResult['PaymentUtilityResult'];
     123                   //var_dump($PayResult);
    119124                   die($request_form1.$FormStr.
    120                           '<script type="text/javascript" language="JavaScript">
     125                          '<script type="text/javascript">
    121126                          document.getElementById("paymentUTLfrm").submit();
    122127                          </script></form></body></html>');
     
    126131           
    127132            edd_update_payment_status($payment, 'failed');
    128             edd_insert_payment_note( $payment, 'P02: خطا در اتصال به بانک');
    129             edd_set_error( 'pay_02', ':P02: خطا در اتصال به بانک' );
     133            edd_insert_payment_note( $payment, __('Error connecting to payment gateway.[code: 02]', 'ex_lang'));
     134            edd_set_error( 'pay_02', __('Error connecting to payment gateway.[code: 02]', 'ex_lang'));
    130135            edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
    131136          }               
     
    134139    else
    135140    {
    136         edd_set_error( 'pay_01', 'P01:خطا در ایجاد پرداخت، لطفاً مجدداً تلاش کنید...' );
     141        edd_set_error( 'pay_01', __('Error creating payment, please try again' , 'ex_lang'));
    137142        edd_send_back_to_checkout('?payment-mode=' . $purchase_data['post_data']['edd-gateway']);
    138143    }
     
    143148function bmi_verify()
    144149{
     150    @session_start();
    145151    //error_reporting(0);
    146152    global $edd_options;
     
    168174                if ($client->fault)
    169175                {
    170                     edd_set_error( 'ver_00', 'V00:تراکنش ناموفق بود.<br>اگر وجهی از حساب شما کسر شده باشد، تا پایان روز جاری به حساب شما باز خواهد گشت.' );
     176                    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'));
    171177                    edd_update_payment_status($_SESSION['Melli_payment'], 'failed');
    172                     edd_insert_payment_note( $_SESSION['Melli_payment'], 'V00:'.'<pre>خطا در تاییدیه بانک</pre>' );
     178                    edd_insert_payment_note( $_SESSION['Melli_payment'], __('Error in Bank Verification[code: 03]' , 'ex_lang'));
    173179                    edd_send_back_to_checkout('?payment-mode=Melli');
    174180               
     
    216222        {
    217223
    218                 edd_set_error( 'rev_00', 'R00:تراکنش ناموفق بود.<br>اگر وجهی از حساب شما کسر شده باشد، تا پایان روز جاری به حساب شما باز خواهد گشت.' );
     224                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'));
    219225                edd_update_payment_status($_SESSION['Melli_payment'], 'failed');
    220                 edd_insert_payment_note( $_SESSION['Melli_payment'], 'R00:'.'<pre>'.$err_msg.'</pre>' );
     226                edd_insert_payment_note( $_SESSION['Melli_payment'], 'R04:'.'<pre>'.$err_msg.'</pre>' );
    221227                edd_send_back_to_checkout('?payment-mode=Melli');
    222228        }
     
    229235            $do_publish = false;
    230236            edd_update_payment_status($payment, 'publish');
    231             edd_insert_payment_note( $payment, 'شماره تراکنش:'.$TraceNo);
    232             echo "<script type='text/javascript'>alert('کد تراکنش خرید بانک : ".$TraceNo."');</script>";
     237            edd_insert_payment_note( $payment, __('Transaction Number:', 'ex_lang').$TraceNo);
     238            //echo "<script type='text/javascript'>alert('کد تراکنش خرید بانک : ".$TraceNo."');</script>";
    233239        }
    234240    }   
     
    240246        array (
    241247            'id'        =>  'Melli_settings',
    242             'name'      =>  '<strong>پيکربندي درگاه بانک ملی</strong><br>(در حالت آزمایشی این قسمت را تکمیل نکنید)',
    243             'desc'      =>  'پيکربندي درگاه بانک ملی ایران با تنظيمات فروشگاه',
     248            'name'      =>  __('<b>Sadad Gateway Settings</b><br>Do not complete in the test mode', 'ex_lang'),
     249            'desc'      =>  '',
    244250            'type'      =>  'header'
    245251        ),
    246252        array (
    247253            'id'        =>  'Melli_MerchantID',
    248             'name'      =>  'شماره پذیرنده',
     254            'name'      =>  __('Merchant ID', 'ex_lang'),//شماره پذیرنده
    249255            'desc'      =>  '',
    250256            'type'      =>  'text',
     
    253259        array (
    254260            'id'        =>  'Melli_Terminal_ID',
    255             'name'      =>  'شماره ترمینال',
     261            'name'      =>  __('Terminal ID', 'ex_lang'),//شماره ترمینال
    256262            'desc'      =>  '',
    257263            'type'      =>  'text',
     
    260266        array (
    261267            'id'        =>  'Melli_Password',
    262             'name'      =>  'رمز عبور',
     268            'name'      =>  __('Password', 'ex_lang'),//رمز
    263269            'desc'      =>  '',
    264270            'type'      =>  'text',
  • bank-melli-edd-gateway/trunk/menu_setup.php

    r1371538 r1834018  
    88{
    99
    10     add_menu_page('<span>بانک ملی ایران</span>', '<span>بانک ملی ایران</span>', 'activate_plugins', "melli_bank_gate", 'bmi_load_inteface', plugin_dir_url( __FILE__ ).'/images/icon.png');
    11     add_submenu_page("melli_bank_gate", '<span>درباره ما</span>', '<span>درباره ما</span>', 'activate_plugins', "melli_bank_gate_about", "bmi_load_about");
    12     add_submenu_page("melli_bank_gate", '<span>خبرنامه</span>', '<span>خبرنامه</span>', 'activate_plugins', "melli_bank_gate_news", "bmi_load_news");
     10    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');
     11    add_submenu_page("melli_bank_gate", __('About', 'ex_lang'), __('About', 'ex_lang'), 'activate_plugins', "melli_bank_gate_about", "bmi_load_about");
     12    add_submenu_page("melli_bank_gate", __('Newsletters', 'ex_lang'), __('Newsletters', 'ex_lang'), 'activate_plugins', "melli_bank_gate_news", "bmi_load_news");
    1313
    1414}
  • bank-melli-edd-gateway/trunk/readme.txt

    r1576697 r1834018  
    44Author URI: http://ham3da.ir/
    55Donate link: http://ham3da.ir/
    6 Tags: bank melli, melli, easy digital downloads, EDD gateways,درگاه بانک ملی,بانک ملی
     6Tags: bank melli, melli, easy digital downloads, EDD gateways,درگاه بانک ملی,بانک ملی, درگاه بانک ملی برای edd
    77Requires at least: 3.0
    8 Tested up to: 4.7.1
    9 Stable tag: 4.7.1
     8Tested up to: 4.9.4
     9Stable tag: 4.9.4
    1010License: GPLv2
    1111
     
    3737
    3838== Donations ==
    39 You can Donate plugin author here http://proappco.com/payment/
     39You can Donate plugin author here https://ham3da.ir/payment/
    4040
    4141== Upgrade Notice ==
     42= 1.4.1 =
     43* Delete nusaop class
     44* Use soap instead of nusoap
     45* Add standard translation
    4246= 1.4 =
    4347* Update nusaop class
     
    5054
    5155== Changelog ==
     56= 1.4.1 =
     57* Delete nusaop class
     58* Use soap instead of nusoap
     59* Add standard translation
    5260= 1.4 =
    5361* Update nusaop class
Note: See TracChangeset for help on using the changeset viewer.