This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Your Shipping plugin | |
Plugin URI: http://woothemes.com/woocommerce | |
Description: Your shipping method plugin | |
Version: 1.0.0 | |
Author: WooThemes | |
Author URI: http://woothemes.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Break html5 cart caching */ | |
add_action('wp_enqueue_scripts', 'cartcache_enqueue_scripts', 100); | |
function cartcache_enqueue_scripts() | |
{ | |
wp_deregister_script('wc-cart-fragments'); | |
wp_enqueue_script( 'wc-cart-fragments', get_template_directory_uri() . '/cart-fragments.js', array( 'jquery', 'jquery-cookie' ), '1.0', true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RESULT_CODES = (<<-EOT).split(/\r?\n/).reject {|s| s.match(/^( *#.*)?$/)}.map { |s| s.sub(/^ +/,'').split(/ +/,2) }.to_h | |
# Copied from http://dwalins.com/2014/codigo-de-respuesta-de-sermepa-redsys/ | |
0101 Tarjeta Caducada | |
0102 Tarjeta en excepción transitoria o bajo sospecha de fraude | |
0104 Operación no permitida para esa tarjeta o terminal | |
0106 Intentos de PIN excedidos | |
0116 Disponible Insuficiente | |
0118 Tarjeta no Registrada | |
0125 Tarjeta no efectiva | |
0129 Código de seguridad (CVV2/CVC2) incorrecto |