Plugin Directory

Changeset 1427473


Ignore:
Timestamp:
05/31/2016 11:00:48 AM (10 years ago)
Author:
nimblepayments
Message:

WordPress Multisite compatibility

Location:
nimblepayments/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • nimblepayments/trunk/lib/Nimble/base/Authorization.php

    r1365565 r1427473  
    229229    public function getToken_Type ()
    230230    {
    231         return $this->access_token;
     231        return $this->token_type;
    232232    }
    233233
  • nimblepayments/trunk/lib/Nimble/base/ConfigSDK.php

    r1365565 r1427473  
    4141    /**
    4242     *
    43      * @var int MAX_ATTEMPS constant var
    44      */
    45     const MAX_ATTEMPS = 3;
    46 
    47     /**
    48      *
    4943     * @var int TIMEOUT (seconds) constant var
    5044     */
    51     const TIMEOUT = 10;
     45    const TIMEOUT = 30;
    5246}
  • nimblepayments/trunk/lib/Nimble/base/NimbleAPI.php

    r1365565 r1427473  
    6363
    6464    /**
    65      *
    66      * @var int $ attemps (integer contain attempts numbers to a service)
    67      */
    68     protected $attemps = 0;
    69 
    70     /**
    71      *
    72      * @var int $ max_attemps (maximum number of attempts at connections)
    73      */
    74     protected $max_attemps = ConfigSDK::MAX_ATTEMPS;
    75    
    76     /**
    7765     *
    7866     * @var bool $ use_curl (if need curl_lib to work)
     
    164152
    165153            $this->setLastStatusCode(curl_getinfo($curl_connect, CURLINFO_HTTP_CODE));
    166             $this->getLastStatusCode() == 200 ? $this->setAttemps(0) : $this->attemps ++;
    167            
    168             // getLastStatusCode() return 0 in timeout
    169             if (($this->getLastStatusCode() == 401 or $this->getLastStatusCode() == 403 or $this->getLastStatusCode() == 0)  and
    170                 $this->getAttemps() <= $this->max_attemps) {
    171                 $response = $this->rest_api_call();
    172             }
    173 
    174             $this->setAttemps(0);
     154
    175155            if ($this->authorization->is_preauthorized_request) {
    176156                $this->authorization->setAccessParams($response);
     
    270250        return $this;
    271251    }
    272 
    273     /**
    274      * Method getAttemps.
    275      *
    276      * @return int. Returns the number of attempts Connection
    277      */
    278     public function getAttemps ()
    279     {
    280         return $this->attemps;
    281     }
    282    
     252 
    283253    /**
    284254     * Method getHeaders
     
    318288    }
    319289
    320     /**
    321      * Method setAttemps
    322      *
    323      * @param int $attemps.
    324      * @return NimbleAPI object. Modifies the number of attempts Connection
    325      */
    326     public function setAttemps ($attemps)
    327     {
    328         $this->attemps = $attemps;
    329         return $this;
    330     }
    331290
    332291    /**
  • nimblepayments/trunk/lib/Nimble/extensions/wordpress/WP_NimbleAPI.php

    r1365565 r1427473  
    6767                $this->setLastStatusCode(0);
    6868            }
    69             $this->getLastStatusCode() == 200 ? $this->setAttemps(0) : $this->attemps ++;
    70            
    71             // getLastStatusCode() return 0 in timeout
    72             if (($this->getLastStatusCode() == 401 or $this->getLastStatusCode() == 403 or $this->getLastStatusCode() == 0)  and
    73                 $this->getAttemps() <= $this->max_attemps) {
    74                 $response = $this->rest_api_call();
    75             }
    7669
    77             $this->setAttemps(0);
    7870            if ($this->authorization->is_preauthorized_request) {
    7971                $this->authorization->setAccessParams($response);
  • nimblepayments/trunk/nimblepayments.php

    r1425395 r1427473  
    55Plugin URI: https://www.nimblepayments.com
    66Description: Nimble Payments is an online payment gateway supported by BBVA that enables you to accept online payments flexibly and safely.
    7 Version: 1.0.7
     7Version: 1.0.8
    88Author: BBVA
    99Author URI:
     
    183183
    184184
    185 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
     185/**
     186 * Check if WooCommerce is active (including WordPress Multisite)
     187 **/
     188if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )
     189    || ( is_multisite() && array_key_exists( 'woocommerce/woocommerce.php', get_site_option( 'active_sitewide_plugins') ) ) ){
    186190    $oWoocommerceNimblePayments = Woocommerce_Nimble_Payments::getInstance();
    187191    register_activation_hook(__FILE__, array($oWoocommerceNimblePayments, 'activar_plugin'));
  • nimblepayments/trunk/readme.txt

    r1425395 r1427473  
    3636
    37371. Asegurate de tener instalado y activado el plugin **WooCommerce**.
    38 2. Subir los ficheros del plugin **WooCommerce Nimble Payments** a la ruta `/wp-content/plugins/woocommerce-nimble-payments`, o realizar la instalación utilizando el directorio de plugins de WordPress.
     382. Subir los ficheros del plugin **NimblePayments** a la ruta `/wp-content/plugins/nimblepayments`, o realizar la instalación utilizando el directorio de plugins de WordPress.
    39393. Activar el plugin en la ventana de 'Plugins' dentro de WordPress.
    40404. Habilita la pasarela de pago Nimble Payments en la ruta WooCommerce > Ajustes > Finalizar compra > Nimble Payments.
     
    4949== Changelog ==
    5050
     51= 1.0.8 =
     52* Corrección: Compatibilidad con WordPress Multisite
     53
     54
    5155= 1.0.7 =
    5256* Corrección: Compatibilidad con WordPress 4.5
     
    5963== Upgrade Notice ==
    6064
     65= 1.0.8 =
     66La versión 1.0.8 corrige un error de compatibilidad con WordPress Multisite.
     67
    6168= 1.0.7 =
    62 Actualización importante. La versión 1.0.7 corrige un error de compatibilidad con con WordPress 4.5.
     69Actualización importante. La versión 1.0.7 corrige un error de compatibilidad con WordPress 4.5.
    6370
    6471= 1.0.6 =
Note: See TracChangeset for help on using the changeset viewer.