Plugin Directory

Changeset 2252529


Ignore:
Timestamp:
03/01/2020 09:06:06 AM (6 years ago)
Author:
Mofsy
Message:

New - 3.0.2

Location:
wc-robokassa/trunk
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • wc-robokassa/trunk/includes/class-wc-robokassa-method.php

    r2250976 r2252529  
    14751475    public function process_payment($order_id)
    14761476    {
    1477         /**
    1478          * Get order object
    1479          */
    14801477        $order = wc_get_order($order_id);
    1481        
    1482         /**
    1483          * Order fail
    1484          */
     1478
    14851479        if($order === false)
    14861480        {
     
    14951489
    14961490        // hook
    1497         do_action('wc_robokassa_process_payment_start', $order_id, $order);
    1498 
    1499         /**
    1500          * Add order note
    1501          */
     1491        do_action('wc_robokassa_before_process_payment', $order_id, $order);
     1492
     1493        WC_Robokassa()->get_logger()->debug('process_payment: order', $order);
     1494
    15021495        if(method_exists($order, 'add_order_note'))
    15031496        {
     
    15051498        }
    15061499
    1507         /**
    1508          * Page skipping enabled
    1509          */
    15101500        if($this->get_page_skipping() === 'yes')
    15111501        {
  • wc-robokassa/trunk/includes/class-wc-robokassa.php

    r2251174 r2252529  
    1919     * Logger
    2020     *
    21      * @var WC_Gatework_Logger
     21     * @var WC_Robokassa_Logger
    2222     */
    2323    public $logger = false;
     
    275275    public function load_currency()
    276276    {
    277         $wc_currency = gatework_get_wc_currency();
     277        $wc_currency = wc_robokassa_get_wc_currency();
    278278
    279279        /**
     
    301301    public function load_wc_version()
    302302    {
    303         $wc_version = gatework_get_wc_version();
     303        $wc_version = wc_robokassa_get_wc_version();
    304304
    305305        // log
     
    376376        try
    377377        {
    378             $logger = new WC_Gatework_Logger();
     378            $logger = new WC_Robokassa_Logger();
    379379        }
    380380        catch(Exception $e)
     
    416416     * Get logger
    417417     *
    418      * @return WC_Gatework_Logger|null
     418     * @return WC_Robokassa_Logger|null
    419419     */
    420420    public function get_logger()
     
    458458    public function wc_robokassa_admin_notices()
    459459    {
     460        $section = '';
     461        if(isset($_GET['section']))
     462        {
     463            $section = $_GET['section'];
     464        }
     465
    460466        $settings_version = get_option('wc_robokassa_last_settings_update_version');
    461467
     
    463469         * Global notice: Require update settings
    464470         */
    465         if(get_option('wc_robokassa_last_settings_update_version') !== false && $settings_version < WC_ROBOKASSA_VERSION && $_GET['section'] !== 'robokassa')
     471        if(get_option('wc_robokassa_last_settings_update_version') !== false
     472           && $settings_version < WC_ROBOKASSA_VERSION
     473           && $section !== 'robokassa')
    466474        {
    467475        }
  • wc-robokassa/trunk/includes/functions-wc-robokassa.php

    r2251174 r2252529  
    1515    return false;
    1616}
     17
     18/**
     19 * Get current version WooCommerce
     20 *
     21 * @since 3.0.2
     22 */
     23function wc_robokassa_get_wc_version()
     24{
     25    if(function_exists('is_woocommerce_active') && is_woocommerce_active())
     26    {
     27        global $woocommerce;
     28
     29        if(isset($woocommerce->version))
     30        {
     31            return $woocommerce->version;
     32        }
     33    }
     34
     35    if(!function_exists('get_plugins'))
     36    {
     37        require_once(ABSPATH . 'wp-admin/includes/plugin.php');
     38    }
     39
     40    $plugin_folder = get_plugins('/woocommerce');
     41    $plugin_file = 'woocommerce.php';
     42
     43    if(isset($plugin_folder[$plugin_file]['Version']))
     44    {
     45        return $plugin_folder[$plugin_file]['Version'];
     46    }
     47
     48    return null;
     49}
     50
     51/**
     52 * Get WooCommerce currency code
     53 *
     54 * @since 3.0.2
     55 *
     56 * @return string
     57 */
     58function wc_robokassa_get_wc_currency()
     59{
     60    return get_woocommerce_currency();
     61}
  • wc-robokassa/trunk/readme.txt

    r2251174 r2252529  
    4646
    4747== Changelog ==
     48
     49= 3.0.2 =
     50* Remove gatework
    4851
    4952= 3.0.1 =
  • wc-robokassa/trunk/wc-robokassa.php

    r2251174 r2252529  
    44 * Description: Integration Robokassa in WooCommerce as payment gateway plugin.
    55 * Plugin URI: https://mofsy.ru/projects/wc-robokassa
    6  * Version: 3.0.1
     6 * Version: 3.0.2
    77 * WC requires at least: 3.0
    88 * WC tested up to: 3.9
     
    1919defined('ABSPATH') || exit;
    2020
    21 if(defined('WC_ROBOKASSA_VERSION') !== true)
     21if(class_exists('WC_Robokassa') !== true)
    2222{
    2323    $plugin_data = get_file_data(__FILE__, array('Version' => 'Version'));
    2424    define('WC_ROBOKASSA_VERSION', $plugin_data['Version']);
    25 }
    2625
    27 if(defined('WC_ROBOKASSA_URL') !== true)
    28 {
    2926    define('WC_ROBOKASSA_URL', plugin_dir_url(__FILE__));
    30 }
     27    define('WC_ROBOKASSA_PLUGIN_DIR', plugin_dir_path(__FILE__));
     28    define('WC_ROBOKASSA_PLUGIN_NAME', plugin_basename(__FILE__));
    3129
    32 if(defined('WC_ROBOKASSA_PLUGIN_DIR') !== true)
    33 {
    34     define('WC_ROBOKASSA_PLUGIN_DIR', plugin_dir_path(__FILE__));
    35 }
    36 
    37 if(defined('WC_ROBOKASSA_PLUGIN_NAME') !== true)
    38 {
    39     define('WC_ROBOKASSA_PLUGIN_NAME', plugin_basename(__FILE__));
    40 }
    41 
    42 /**
    43  * GateWork
    44  */
    45 include_once __DIR__ . '/gatework/init.php';
    46 
    47 /**
    48  * Gateway class
    49  */
    50 if(class_exists('WC_Robokassa') !== true)
    51 {
    5230    include_once __DIR__ . '/includes/functions-wc-robokassa.php';
     31    include_once __DIR__ . '/includes/class-wc-robokassa-logger.php';
    5332    include_once __DIR__ . '/includes/class-wc-robokassa.php';
    5433}
    5534
    56 /**
    57  * Run
    58  */
    5935add_action('plugins_loaded', 'WC_Robokassa', 5);
Note: See TracChangeset for help on using the changeset viewer.