Changeset 1427473
- Timestamp:
- 05/31/2016 11:00:48 AM (10 years ago)
- Location:
- nimblepayments/trunk
- Files:
-
- 6 edited
-
lib/Nimble/base/Authorization.php (modified) (1 diff)
-
lib/Nimble/base/ConfigSDK.php (modified) (1 diff)
-
lib/Nimble/base/NimbleAPI.php (modified) (4 diffs)
-
lib/Nimble/extensions/wordpress/WP_NimbleAPI.php (modified) (1 diff)
-
nimblepayments.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nimblepayments/trunk/lib/Nimble/base/Authorization.php
r1365565 r1427473 229 229 public function getToken_Type () 230 230 { 231 return $this-> access_token;231 return $this->token_type; 232 232 } 233 233 -
nimblepayments/trunk/lib/Nimble/base/ConfigSDK.php
r1365565 r1427473 41 41 /** 42 42 * 43 * @var int MAX_ATTEMPS constant var44 */45 const MAX_ATTEMPS = 3;46 47 /**48 *49 43 * @var int TIMEOUT (seconds) constant var 50 44 */ 51 const TIMEOUT = 10;45 const TIMEOUT = 30; 52 46 } -
nimblepayments/trunk/lib/Nimble/base/NimbleAPI.php
r1365565 r1427473 63 63 64 64 /** 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 /**77 65 * 78 66 * @var bool $ use_curl (if need curl_lib to work) … … 164 152 165 153 $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 175 155 if ($this->authorization->is_preauthorized_request) { 176 156 $this->authorization->setAccessParams($response); … … 270 250 return $this; 271 251 } 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 283 253 /** 284 254 * Method getHeaders … … 318 288 } 319 289 320 /**321 * Method setAttemps322 *323 * @param int $attemps.324 * @return NimbleAPI object. Modifies the number of attempts Connection325 */326 public function setAttemps ($attemps)327 {328 $this->attemps = $attemps;329 return $this;330 }331 290 332 291 /** -
nimblepayments/trunk/lib/Nimble/extensions/wordpress/WP_NimbleAPI.php
r1365565 r1427473 67 67 $this->setLastStatusCode(0); 68 68 } 69 $this->getLastStatusCode() == 200 ? $this->setAttemps(0) : $this->attemps ++;70 71 // getLastStatusCode() return 0 in timeout72 if (($this->getLastStatusCode() == 401 or $this->getLastStatusCode() == 403 or $this->getLastStatusCode() == 0) and73 $this->getAttemps() <= $this->max_attemps) {74 $response = $this->rest_api_call();75 }76 69 77 $this->setAttemps(0);78 70 if ($this->authorization->is_preauthorized_request) { 79 71 $this->authorization->setAccessParams($response); -
nimblepayments/trunk/nimblepayments.php
r1425395 r1427473 5 5 Plugin URI: https://www.nimblepayments.com 6 6 Description: Nimble Payments is an online payment gateway supported by BBVA that enables you to accept online payments flexibly and safely. 7 Version: 1.0. 77 Version: 1.0.8 8 8 Author: BBVA 9 9 Author URI: … … 183 183 184 184 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 **/ 188 if ( 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') ) ) ){ 186 190 $oWoocommerceNimblePayments = Woocommerce_Nimble_Payments::getInstance(); 187 191 register_activation_hook(__FILE__, array($oWoocommerceNimblePayments, 'activar_plugin')); -
nimblepayments/trunk/readme.txt
r1425395 r1427473 36 36 37 37 1. 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.38 2. 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. 39 39 3. Activar el plugin en la ventana de 'Plugins' dentro de WordPress. 40 40 4. Habilita la pasarela de pago Nimble Payments en la ruta WooCommerce > Ajustes > Finalizar compra > Nimble Payments. … … 49 49 == Changelog == 50 50 51 = 1.0.8 = 52 * Corrección: Compatibilidad con WordPress Multisite 53 54 51 55 = 1.0.7 = 52 56 * Corrección: Compatibilidad con WordPress 4.5 … … 59 63 == Upgrade Notice == 60 64 65 = 1.0.8 = 66 La versión 1.0.8 corrige un error de compatibilidad con WordPress Multisite. 67 61 68 = 1.0.7 = 62 Actualización importante. La versión 1.0.7 corrige un error de compatibilidad con conWordPress 4.5.69 Actualización importante. La versión 1.0.7 corrige un error de compatibilidad con WordPress 4.5. 63 70 64 71 = 1.0.6 =
Note: See TracChangeset
for help on using the changeset viewer.