Version Description
Download this release
Release Info
| Developer | mercadopago |
| Plugin | |
| Version | 3.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 3.0.2 to 3.0.4
- includes/WC_WooMercadoPago_TicketGateway.php +28 -39
- includes/sdk/lib/mercadopago.php +14 -14
- readme.txt +14 -2
- templates/credit-card/payment-form.php +5 -5
- templates/ticket/ticket-form.php +4 -2
- woocommerce-mercadopago.php +2 -2
includes/WC_WooMercadoPago_TicketGateway.php
CHANGED
|
@@ -19,7 +19,7 @@ require_once dirname( __FILE__ ) . '/sdk/lib/mercadopago.php';
|
|
| 19 |
class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
| 20 |
|
| 21 |
public function __construct( $is_instance = false ) {
|
| 22 |
-
|
| 23 |
// Mercao Pago instance.
|
| 24 |
$this->site_data = WC_Woo_Mercado_Pago_Module::get_site_data( true );
|
| 25 |
$this->mp = new MP(
|
|
@@ -55,7 +55,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 55 |
$this->coupon_mode = $this->get_option( 'coupon_mode', 'no' );
|
| 56 |
$this->stock_reduce_mode = $this->get_option( 'stock_reduce_mode', 'no' );
|
| 57 |
$this->gateway_discount = $this->get_option( 'gateway_discount', 0 );
|
| 58 |
-
|
| 59 |
// Logging and debug.
|
| 60 |
$_mp_debug_mode = get_option( '_mp_debug_mode', '' );
|
| 61 |
if ( ! empty ( $_mp_debug_mode ) ) {
|
|
@@ -105,11 +105,6 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 105 |
'woocommerce_gateway_title',
|
| 106 |
array( $this, 'get_payment_method_title_ticket' ), 10, 2
|
| 107 |
);
|
| 108 |
-
// Customizes thank you page.
|
| 109 |
-
add_filter(
|
| 110 |
-
'woocommerce_thankyou_order_received_text',
|
| 111 |
-
array( $this, 'show_ticket_button' ), 10, 2
|
| 112 |
-
);
|
| 113 |
|
| 114 |
if ( ! empty( $this->settings['enabled'] ) && $this->settings['enabled'] == 'yes' ) {
|
| 115 |
if ( ! $is_instance ) {
|
|
@@ -120,7 +115,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 120 |
);
|
| 121 |
// Checkout updates.
|
| 122 |
add_action(
|
| 123 |
-
'
|
| 124 |
array( $this, 'update_mp_settings_script_ticket' )
|
| 125 |
);
|
| 126 |
}
|
|
@@ -380,7 +375,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 380 |
$message = $response['response']['message'];
|
| 381 |
$status = $response['status'];
|
| 382 |
$this->write_log( __FUNCTION__,
|
| 383 |
-
'cancel payment of id ' . $p_id . ' => ' .
|
| 384 |
( $status >= 200 && $status < 300 ? 'SUCCESS' : 'FAIL - ' . $message )
|
| 385 |
);
|
| 386 |
}
|
|
@@ -456,25 +451,8 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 456 |
MA.put();
|
| 457 |
</script>';
|
| 458 |
}
|
| 459 |
-
}
|
| 460 |
-
|
| 461 |
-
public function add_checkout_scripts_ticket() {
|
| 462 |
-
if ( is_checkout() && $this->is_available() ) {
|
| 463 |
-
if ( ! get_query_var( 'order-received' ) ) {
|
| 464 |
-
wp_enqueue_style(
|
| 465 |
-
'woocommerce-mercadopago-style',
|
| 466 |
-
plugins_url( 'assets/css/custom_checkout_mercadopago.css', plugin_dir_path( __FILE__ ) )
|
| 467 |
-
);
|
| 468 |
-
wp_enqueue_script(
|
| 469 |
-
'woocommerce-mercadopago-ticket-js',
|
| 470 |
-
'https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js'
|
| 471 |
-
);
|
| 472 |
-
}
|
| 473 |
-
}
|
| 474 |
-
}
|
| 475 |
-
|
| 476 |
-
public function show_ticket_button( $thankyoutext, $order ) {
|
| 477 |
|
|
|
|
| 478 |
$used_gateway = ( method_exists( $order, 'get_meta' ) ) ?
|
| 479 |
$order->get_meta( '_used_gateway' ) :
|
| 480 |
get_post_meta( $order->id, '_used_gateway', true );
|
|
@@ -496,11 +474,26 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 496 |
__( 'Print the Ticket', 'woocommerce-mercadopago' ) .
|
| 497 |
'</a> ';
|
| 498 |
$added_text = '<p>' . $html . '</p>';
|
| 499 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 500 |
}
|
| 501 |
|
| 502 |
public function payment_fields() {
|
| 503 |
-
|
| 504 |
$amount = $this->get_order_total();
|
| 505 |
$logged_user_email = ( wp_get_current_user()->ID != 0 ) ? wp_get_current_user()->user_email : null;
|
| 506 |
$customer = isset( $logged_user_email ) ? $this->mp->get_or_create_customer( $logged_user_email ) : null;
|
|
@@ -713,7 +706,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 713 |
array_push( $items, array(
|
| 714 |
'id' => $item['product_id'],
|
| 715 |
'title' => html_entity_decode( $product_title ) . ' x ' . $item['qty'],
|
| 716 |
-
'description' => sanitize_file_name( html_entity_decode(
|
| 717 |
strlen( $product_content ) > 230 ?
|
| 718 |
substr( $product_content, 0, 230 ) . '...' :
|
| 719 |
$product_content
|
|
@@ -922,7 +915,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 922 |
$this->write_log(
|
| 923 |
__FUNCTION__,
|
| 924 |
'payment link generated with success from mercado pago, with structure as follow: ' .
|
| 925 |
-
json_encode( $checkout_info, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE )
|
| 926 |
);
|
| 927 |
// TODO: Verify sandbox availability.
|
| 928 |
//if ( 'yes' == $this->sandbox ) {
|
|
@@ -962,7 +955,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 962 |
$ticket_checkout['discount'] > 0 && WC()->session->chosen_payment_method == 'woo-mercado-pago-ticket' ) {
|
| 963 |
|
| 964 |
$this->write_log( __FUNCTION__, 'ticket checkout trying to apply discount...' );
|
| 965 |
-
|
| 966 |
$value = ( $this->site_data['currency'] == 'COP' || $this->site_data['currency'] == 'CLP' ) ?
|
| 967 |
floor( $ticket_checkout['discount'] / $ticket_checkout['currency_ratio'] ) :
|
| 968 |
floor( $ticket_checkout['discount'] / $ticket_checkout['currency_ratio'] * 100 ) / 100;
|
|
@@ -1227,14 +1220,10 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
|
| 1227 |
);
|
| 1228 |
if ( $this->stock_reduce_mode == 'no' ) {
|
| 1229 |
$order->payment_complete();
|
| 1230 |
-
$order->update_status(
|
| 1231 |
-
WC_Woo_Mercado_Pago_Module::get_wc_status_for_mp_status( 'approved' )
|
| 1232 |
-
);
|
| 1233 |
-
} else {
|
| 1234 |
-
$order->update_status(
|
| 1235 |
-
WC_Woo_Mercado_Pago_Module::get_wc_status_for_mp_status( 'processing' )
|
| 1236 |
-
);
|
| 1237 |
}
|
|
|
|
|
|
|
|
|
|
| 1238 |
break;
|
| 1239 |
case 'pending':
|
| 1240 |
$order->update_status(
|
| 19 |
class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
|
| 20 |
|
| 21 |
public function __construct( $is_instance = false ) {
|
| 22 |
+
|
| 23 |
// Mercao Pago instance.
|
| 24 |
$this->site_data = WC_Woo_Mercado_Pago_Module::get_site_data( true );
|
| 25 |
$this->mp = new MP(
|
| 55 |
$this->coupon_mode = $this->get_option( 'coupon_mode', 'no' );
|
| 56 |
$this->stock_reduce_mode = $this->get_option( 'stock_reduce_mode', 'no' );
|
| 57 |
$this->gateway_discount = $this->get_option( 'gateway_discount', 0 );
|
| 58 |
+
|
| 59 |
// Logging and debug.
|
| 60 |
$_mp_debug_mode = get_option( '_mp_debug_mode', '' );
|
| 61 |
if ( ! empty ( $_mp_debug_mode ) ) {
|
| 105 |
'woocommerce_gateway_title',
|
| 106 |
array( $this, 'get_payment_method_title_ticket' ), 10, 2
|
| 107 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
if ( ! empty( $this->settings['enabled'] ) && $this->settings['enabled'] == 'yes' ) {
|
| 110 |
if ( ! $is_instance ) {
|
| 115 |
);
|
| 116 |
// Checkout updates.
|
| 117 |
add_action(
|
| 118 |
+
'woocommerce_thankyou_' . $this->id,
|
| 119 |
array( $this, 'update_mp_settings_script_ticket' )
|
| 120 |
);
|
| 121 |
}
|
| 375 |
$message = $response['response']['message'];
|
| 376 |
$status = $response['status'];
|
| 377 |
$this->write_log( __FUNCTION__,
|
| 378 |
+
'cancel payment of id ' . $p_id . ' => ' .
|
| 379 |
( $status >= 200 && $status < 300 ? 'SUCCESS' : 'FAIL - ' . $message )
|
| 380 |
);
|
| 381 |
}
|
| 451 |
MA.put();
|
| 452 |
</script>';
|
| 453 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
|
| 455 |
+
$order = wc_get_order( $order_id );
|
| 456 |
$used_gateway = ( method_exists( $order, 'get_meta' ) ) ?
|
| 457 |
$order->get_meta( '_used_gateway' ) :
|
| 458 |
get_post_meta( $order->id, '_used_gateway', true );
|
| 474 |
__( 'Print the Ticket', 'woocommerce-mercadopago' ) .
|
| 475 |
'</a> ';
|
| 476 |
$added_text = '<p>' . $html . '</p>';
|
| 477 |
+
echo $added_text;
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
public function add_checkout_scripts_ticket() {
|
| 481 |
+
if ( is_checkout() && $this->is_available() ) {
|
| 482 |
+
if ( ! get_query_var( 'order-received' ) ) {
|
| 483 |
+
wp_enqueue_style(
|
| 484 |
+
'woocommerce-mercadopago-style',
|
| 485 |
+
plugins_url( 'assets/css/custom_checkout_mercadopago.css', plugin_dir_path( __FILE__ ) )
|
| 486 |
+
);
|
| 487 |
+
wp_enqueue_script(
|
| 488 |
+
'woocommerce-mercadopago-ticket-js',
|
| 489 |
+
'https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js'
|
| 490 |
+
);
|
| 491 |
+
}
|
| 492 |
+
}
|
| 493 |
}
|
| 494 |
|
| 495 |
public function payment_fields() {
|
| 496 |
+
|
| 497 |
$amount = $this->get_order_total();
|
| 498 |
$logged_user_email = ( wp_get_current_user()->ID != 0 ) ? wp_get_current_user()->user_email : null;
|
| 499 |
$customer = isset( $logged_user_email ) ? $this->mp->get_or_create_customer( $logged_user_email ) : null;
|
| 706 |
array_push( $items, array(
|
| 707 |
'id' => $item['product_id'],
|
| 708 |
'title' => html_entity_decode( $product_title ) . ' x ' . $item['qty'],
|
| 709 |
+
'description' => sanitize_file_name( html_entity_decode(
|
| 710 |
strlen( $product_content ) > 230 ?
|
| 711 |
substr( $product_content, 0, 230 ) . '...' :
|
| 712 |
$product_content
|
| 915 |
$this->write_log(
|
| 916 |
__FUNCTION__,
|
| 917 |
'payment link generated with success from mercado pago, with structure as follow: ' .
|
| 918 |
+
json_encode( $checkout_info, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE )
|
| 919 |
);
|
| 920 |
// TODO: Verify sandbox availability.
|
| 921 |
//if ( 'yes' == $this->sandbox ) {
|
| 955 |
$ticket_checkout['discount'] > 0 && WC()->session->chosen_payment_method == 'woo-mercado-pago-ticket' ) {
|
| 956 |
|
| 957 |
$this->write_log( __FUNCTION__, 'ticket checkout trying to apply discount...' );
|
| 958 |
+
|
| 959 |
$value = ( $this->site_data['currency'] == 'COP' || $this->site_data['currency'] == 'CLP' ) ?
|
| 960 |
floor( $ticket_checkout['discount'] / $ticket_checkout['currency_ratio'] ) :
|
| 961 |
floor( $ticket_checkout['discount'] / $ticket_checkout['currency_ratio'] * 100 ) / 100;
|
| 1220 |
);
|
| 1221 |
if ( $this->stock_reduce_mode == 'no' ) {
|
| 1222 |
$order->payment_complete();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1223 |
}
|
| 1224 |
+
$order->update_status(
|
| 1225 |
+
WC_Woo_Mercado_Pago_Module::get_wc_status_for_mp_status( 'approved' )
|
| 1226 |
+
);
|
| 1227 |
break;
|
| 1228 |
case 'pending':
|
| 1229 |
$order->update_status(
|
includes/sdk/lib/mercadopago.php
CHANGED
|
@@ -12,7 +12,7 @@ $GLOBALS['LIB_LOCATION'] = dirname( __FILE__ );
|
|
| 12 |
|
| 13 |
class MP {
|
| 14 |
|
| 15 |
-
private $version = '3.0.
|
| 16 |
private $client_id;
|
| 17 |
private $client_secret;
|
| 18 |
private $ll_access_token;
|
|
@@ -878,7 +878,7 @@ class MPRestClient {
|
|
| 878 |
if ( $api_result === FALSE ) {
|
| 879 |
throw new MercadoPagoException ( curl_error ( $connect ) );
|
| 880 |
}
|
| 881 |
-
|
| 882 |
if ( $api_http_code != null && $api_result != null ) {
|
| 883 |
// A common response without error.
|
| 884 |
$response = array (
|
|
@@ -886,7 +886,7 @@ class MPRestClient {
|
|
| 886 |
'response' => json_decode( $api_result, true )
|
| 887 |
);
|
| 888 |
}
|
| 889 |
-
|
| 890 |
// Error log API.
|
| 891 |
if ( $response != null && $response['status'] >= 400 && self::$check_loop == 0 ) {
|
| 892 |
try {
|
|
@@ -932,14 +932,14 @@ class MPRestClient {
|
|
| 932 |
throw new MercadoPagoException( 'error to call API LOGS' . $e );
|
| 933 |
}
|
| 934 |
}
|
| 935 |
-
|
| 936 |
self::$check_loop = 0;
|
| 937 |
-
|
| 938 |
curl_close( $connect );
|
| 939 |
-
|
| 940 |
return $response;
|
| 941 |
}
|
| 942 |
-
|
| 943 |
private static function sendErrorLog( $code, $errors, $version ) {
|
| 944 |
$data = array(
|
| 945 |
'code' => $code,
|
|
@@ -1001,7 +1001,7 @@ class MPRestClient {
|
|
| 1001 |
}
|
| 1002 |
|
| 1003 |
class MeliRestClient {
|
| 1004 |
-
|
| 1005 |
const API_BASE_URL = 'https://api.mercadolibre.com';
|
| 1006 |
private static $email_admin = '';
|
| 1007 |
private static $check_loop = 0;
|
|
@@ -1115,7 +1115,7 @@ class MeliRestClient {
|
|
| 1115 |
if ( $api_result === FALSE ) {
|
| 1116 |
throw new MercadoPagoException ( curl_error ( $connect ) );
|
| 1117 |
}
|
| 1118 |
-
|
| 1119 |
if ( $api_http_code != null && $api_result != null ) {
|
| 1120 |
// A common response without error.
|
| 1121 |
$response = array (
|
|
@@ -1123,7 +1123,7 @@ class MeliRestClient {
|
|
| 1123 |
'response' => json_decode( $api_result, true ),
|
| 1124 |
);
|
| 1125 |
}
|
| 1126 |
-
|
| 1127 |
// Error log API.
|
| 1128 |
if ( $response != null && $response['status'] >= 400 && self::$check_loop == 0 ) {
|
| 1129 |
try {
|
|
@@ -1169,14 +1169,14 @@ class MeliRestClient {
|
|
| 1169 |
throw new MercadoPagoException( 'error to call API LOGS' . $e );
|
| 1170 |
}
|
| 1171 |
}
|
| 1172 |
-
|
| 1173 |
self::$check_loop = 0;
|
| 1174 |
-
|
| 1175 |
curl_close( $connect );
|
| 1176 |
-
|
| 1177 |
return $response;
|
| 1178 |
}
|
| 1179 |
-
|
| 1180 |
private static function sendErrorLog( $code, $errors, $version ) {
|
| 1181 |
$data = array(
|
| 1182 |
'code' => $code,
|
| 12 |
|
| 13 |
class MP {
|
| 14 |
|
| 15 |
+
private $version = '3.0.4';
|
| 16 |
private $client_id;
|
| 17 |
private $client_secret;
|
| 18 |
private $ll_access_token;
|
| 878 |
if ( $api_result === FALSE ) {
|
| 879 |
throw new MercadoPagoException ( curl_error ( $connect ) );
|
| 880 |
}
|
| 881 |
+
|
| 882 |
if ( $api_http_code != null && $api_result != null ) {
|
| 883 |
// A common response without error.
|
| 884 |
$response = array (
|
| 886 |
'response' => json_decode( $api_result, true )
|
| 887 |
);
|
| 888 |
}
|
| 889 |
+
|
| 890 |
// Error log API.
|
| 891 |
if ( $response != null && $response['status'] >= 400 && self::$check_loop == 0 ) {
|
| 892 |
try {
|
| 932 |
throw new MercadoPagoException( 'error to call API LOGS' . $e );
|
| 933 |
}
|
| 934 |
}
|
| 935 |
+
|
| 936 |
self::$check_loop = 0;
|
| 937 |
+
|
| 938 |
curl_close( $connect );
|
| 939 |
+
|
| 940 |
return $response;
|
| 941 |
}
|
| 942 |
+
|
| 943 |
private static function sendErrorLog( $code, $errors, $version ) {
|
| 944 |
$data = array(
|
| 945 |
'code' => $code,
|
| 1001 |
}
|
| 1002 |
|
| 1003 |
class MeliRestClient {
|
| 1004 |
+
|
| 1005 |
const API_BASE_URL = 'https://api.mercadolibre.com';
|
| 1006 |
private static $email_admin = '';
|
| 1007 |
private static $check_loop = 0;
|
| 1115 |
if ( $api_result === FALSE ) {
|
| 1116 |
throw new MercadoPagoException ( curl_error ( $connect ) );
|
| 1117 |
}
|
| 1118 |
+
|
| 1119 |
if ( $api_http_code != null && $api_result != null ) {
|
| 1120 |
// A common response without error.
|
| 1121 |
$response = array (
|
| 1123 |
'response' => json_decode( $api_result, true ),
|
| 1124 |
);
|
| 1125 |
}
|
| 1126 |
+
|
| 1127 |
// Error log API.
|
| 1128 |
if ( $response != null && $response['status'] >= 400 && self::$check_loop == 0 ) {
|
| 1129 |
try {
|
| 1169 |
throw new MercadoPagoException( 'error to call API LOGS' . $e );
|
| 1170 |
}
|
| 1171 |
}
|
| 1172 |
+
|
| 1173 |
self::$check_loop = 0;
|
| 1174 |
+
|
| 1175 |
curl_close( $connect );
|
| 1176 |
+
|
| 1177 |
return $response;
|
| 1178 |
}
|
| 1179 |
+
|
| 1180 |
private static function sendErrorLog( $code, $errors, $version ) {
|
| 1181 |
$data = array(
|
| 1182 |
'code' => $code,
|
readme.txt
CHANGED
|
@@ -5,7 +5,7 @@ Tags: ecommerce, mercadopago, woocommerce
|
|
| 5 |
Requires at least: 4.8
|
| 6 |
Tested up to: 4.8
|
| 7 |
Requires PHP: 5.6
|
| 8 |
-
Stable tag: 3.0.
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 11 |
|
|
@@ -45,7 +45,7 @@ You have two ways to install this module: from your WordPress Store, or by downl
|
|
| 45 |
3. You should find the module read to be installed. Click install.
|
| 46 |
|
| 47 |
= Manual Download =
|
| 48 |
-
1. Get the module sources from a repository (<a href="https://github.com/mercadopago/cart-woocommerce/archive/master.zip">Github</a> or <a href="https://downloads.wordpress.org/plugin/woocommerce-mercadopago.3.0.
|
| 49 |
2. Unzip the folder and find "woocommerce-mercadopago" directory;
|
| 50 |
3. Copy "woocommerce-mercadopago" directory to **[WordPressRootDirectory]/wp-content/plugins/** directory.
|
| 51 |
|
|
@@ -101,6 +101,18 @@ Please, check our FAQ at: https://www.mercadopago.com.br/ajuda/
|
|
| 101 |
|
| 102 |
== Changelog ==
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
= v3.0.2 (19/10/2017) =
|
| 105 |
* Bug fixes
|
| 106 |
- Fixed the absence of [zip_code] field in registered tickets for Brazil.
|
| 5 |
Requires at least: 4.8
|
| 6 |
Tested up to: 4.8
|
| 7 |
Requires PHP: 5.6
|
| 8 |
+
Stable tag: 3.0.4
|
| 9 |
License: GPLv2 or later
|
| 10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
| 11 |
|
| 45 |
3. You should find the module read to be installed. Click install.
|
| 46 |
|
| 47 |
= Manual Download =
|
| 48 |
+
1. Get the module sources from a repository (<a href="https://github.com/mercadopago/cart-woocommerce/archive/master.zip">Github</a> or <a href="https://downloads.wordpress.org/plugin/woocommerce-mercadopago.3.0.4.zip">WordPress Plugin Directory</a>);
|
| 49 |
2. Unzip the folder and find "woocommerce-mercadopago" directory;
|
| 50 |
3. Copy "woocommerce-mercadopago" directory to **[WordPressRootDirectory]/wp-content/plugins/** directory.
|
| 51 |
|
| 101 |
|
| 102 |
== Changelog ==
|
| 103 |
|
| 104 |
+
= v3.0.4 (13/11/2017) =
|
| 105 |
+
* Improvements
|
| 106 |
+
- Improved webhook of ticket printing to a less generic one.
|
| 107 |
+
* Bug fixes
|
| 108 |
+
- FIxed a bug related to payment status of tickets.
|
| 109 |
+
|
| 110 |
+
= v3.0.3 (25/10/2017) =
|
| 111 |
+
* Features
|
| 112 |
+
- Rollout to Uruguay for Custom Checkout and Tickets.
|
| 113 |
+
* Bug fixes
|
| 114 |
+
- Not showing ticket form when not needed.
|
| 115 |
+
|
| 116 |
= v3.0.2 (19/10/2017) =
|
| 117 |
* Bug fixes
|
| 118 |
- Fixed the absence of [zip_code] field in registered tickets for Brazil.
|
templates/credit-card/payment-form.php
CHANGED
|
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 27 |
|
| 28 |
<fieldset id="custom_checkout_fieldset" style="margin:-1px; background:white; display: none;">
|
| 29 |
|
| 30 |
-
<div class="mp-box-inputs mp-line" id="mercadopago-form-coupon" style="padding:0px
|
| 31 |
<label for="couponCodeLabel">
|
| 32 |
<?php echo esc_html__( 'Discount Coupon', 'woocommerce-mercadopago' ); ?>
|
| 33 |
</label>
|
|
@@ -49,7 +49,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 49 |
</div>
|
| 50 |
|
| 51 |
<!-- payment method -->
|
| 52 |
-
<div id="mercadopago-form-customer-and-card" style="padding:0px
|
| 53 |
<div class="mp-box-inputs mp-line">
|
| 54 |
<label for="paymentMethodIdSelector">
|
| 55 |
<?php echo esc_html__( 'Payment Method', 'woocommerce-mercadopago' ); ?> <em>*</em>
|
|
@@ -98,7 +98,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 98 |
</div>
|
| 99 |
</div> <!-- end mercadopago-form-osc -->
|
| 100 |
|
| 101 |
-
<div id="mercadopago-form" style="padding:0px
|
| 102 |
<!-- Card Number -->
|
| 103 |
<div class="mp-box-inputs mp-col-100">
|
| 104 |
<label for="cardNumber">
|
|
@@ -1256,7 +1256,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 1256 |
document.querySelector( MPv1.selectors.mpDoc ).style.display = "none";
|
| 1257 |
|
| 1258 |
document.querySelector( MPv1.selectors.formCustomerAndCard ).removeAttribute( "style" );
|
| 1259 |
-
document.querySelector( MPv1.selectors.formCustomerAndCard ).style.padding = "0px
|
| 1260 |
document.querySelector( MPv1.selectors.mpSecurityCodeCustomerAndCard ).style.display = "none";
|
| 1261 |
|
| 1262 |
// Removing not used fields for this country.
|
|
@@ -1321,7 +1321,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 1321 |
} else {
|
| 1322 |
document.querySelector( MPv1.selectors.mpSecurityCodeCustomerAndCard ).style.display = "none";
|
| 1323 |
document.querySelector( MPv1.selectors.form ).removeAttribute( "style" );
|
| 1324 |
-
document.querySelector( MPv1.selectors.form ).style.padding = "0px
|
| 1325 |
}
|
| 1326 |
Mercadopago.clearSession();
|
| 1327 |
if ( MPv1.create_token_on.event ) {
|
| 27 |
|
| 28 |
<fieldset id="custom_checkout_fieldset" style="margin:-1px; background:white; display: none;">
|
| 29 |
|
| 30 |
+
<div class="mp-box-inputs mp-line" id="mercadopago-form-coupon" style="padding:0px 12px 16px 12px;">
|
| 31 |
<label for="couponCodeLabel">
|
| 32 |
<?php echo esc_html__( 'Discount Coupon', 'woocommerce-mercadopago' ); ?>
|
| 33 |
</label>
|
| 49 |
</div>
|
| 50 |
|
| 51 |
<!-- payment method -->
|
| 52 |
+
<div id="mercadopago-form-customer-and-card" style="padding:0px 12px 0px 12px;">
|
| 53 |
<div class="mp-box-inputs mp-line">
|
| 54 |
<label for="paymentMethodIdSelector">
|
| 55 |
<?php echo esc_html__( 'Payment Method', 'woocommerce-mercadopago' ); ?> <em>*</em>
|
| 98 |
</div>
|
| 99 |
</div> <!-- end mercadopago-form-osc -->
|
| 100 |
|
| 101 |
+
<div id="mercadopago-form" style="padding:0px 12px 0px 12px;">
|
| 102 |
<!-- Card Number -->
|
| 103 |
<div class="mp-box-inputs mp-col-100">
|
| 104 |
<label for="cardNumber">
|
| 1256 |
document.querySelector( MPv1.selectors.mpDoc ).style.display = "none";
|
| 1257 |
|
| 1258 |
document.querySelector( MPv1.selectors.formCustomerAndCard ).removeAttribute( "style" );
|
| 1259 |
+
document.querySelector( MPv1.selectors.formCustomerAndCard ).style.padding = "0px 12px 0px 12px";
|
| 1260 |
document.querySelector( MPv1.selectors.mpSecurityCodeCustomerAndCard ).style.display = "none";
|
| 1261 |
|
| 1262 |
// Removing not used fields for this country.
|
| 1321 |
} else {
|
| 1322 |
document.querySelector( MPv1.selectors.mpSecurityCodeCustomerAndCard ).style.display = "none";
|
| 1323 |
document.querySelector( MPv1.selectors.form ).removeAttribute( "style" );
|
| 1324 |
+
document.querySelector( MPv1.selectors.form ).style.padding = "0px 12px 0px 12px";
|
| 1325 |
}
|
| 1326 |
Mercadopago.clearSession();
|
| 1327 |
if ( MPv1.create_token_on.event ) {
|
templates/ticket/ticket-form.php
CHANGED
|
@@ -34,7 +34,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 34 |
<fieldset id="ticket_checkout_fieldset" style="margin:-1px; background:white; display: none;">
|
| 35 |
|
| 36 |
<!-- coupom -->
|
| 37 |
-
<div class="mp-box-inputs mp-line form-row" id="mercadopago-form-coupon-ticket" style="padding:0px
|
| 38 |
<div class="form-col-8">
|
| 39 |
<label for="couponCodeLabel"><?php echo esc_html__( 'Discount Coupon', 'woocommerce-mercadopago' ); ?></label>
|
| 40 |
<input type="text" id="couponCodeTicket" name="mercadopago_ticket[coupon_code]"
|
|
@@ -159,7 +159,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 159 |
</div>
|
| 160 |
</div>
|
| 161 |
|
| 162 |
-
<div style="padding:0px
|
| 163 |
<p>
|
| 164 |
<?php
|
| 165 |
if ( count( $payment_methods ) > 1 ) :
|
|
@@ -789,6 +789,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 789 |
// flow: MLB
|
| 790 |
if (MPv1Ticket.site_id == "MLB") {
|
| 791 |
MPv1Ticket.actionsMLB();
|
|
|
|
|
|
|
| 792 |
}
|
| 793 |
|
| 794 |
return;
|
| 34 |
<fieldset id="ticket_checkout_fieldset" style="margin:-1px; background:white; display: none;">
|
| 35 |
|
| 36 |
<!-- coupom -->
|
| 37 |
+
<div class="mp-box-inputs mp-line form-row" id="mercadopago-form-coupon-ticket" style="padding:0px 12px 16px 12px;" >
|
| 38 |
<div class="form-col-8">
|
| 39 |
<label for="couponCodeLabel"><?php echo esc_html__( 'Discount Coupon', 'woocommerce-mercadopago' ); ?></label>
|
| 40 |
<input type="text" id="couponCodeTicket" name="mercadopago_ticket[coupon_code]"
|
| 159 |
</div>
|
| 160 |
</div>
|
| 161 |
|
| 162 |
+
<div style="padding:0px 12px 0px 12px;">
|
| 163 |
<p>
|
| 164 |
<?php
|
| 165 |
if ( count( $payment_methods ) > 1 ) :
|
| 789 |
// flow: MLB
|
| 790 |
if (MPv1Ticket.site_id == "MLB") {
|
| 791 |
MPv1Ticket.actionsMLB();
|
| 792 |
+
} else {
|
| 793 |
+
document.querySelector(MPv1Ticket.selectors.formTicket).style.display = "none";
|
| 794 |
}
|
| 795 |
|
| 796 |
return;
|
woocommerce-mercadopago.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: WooCommerce MercadoPago
|
| 4 |
* Plugin URI: https://github.com/mercadopago/cart-woocommerce
|
| 5 |
* Description: This is the <strong>oficial</strong> module of Mercado Pago for WooCommerce plugin. This module enables WooCommerce to use Mercado Pago as a payment Gateway for purchases made in your e-commerce store.
|
| 6 |
-
* Version: 3.0.
|
| 7 |
* Author: Mercado Pago
|
| 8 |
* Author URI: https://www.mercadopago.com.br/developers/
|
| 9 |
* Text Domain: woocommerce-mercadopago
|
|
@@ -87,7 +87,7 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
|
|
| 87 |
// ============================================================
|
| 88 |
|
| 89 |
// General constants.
|
| 90 |
-
const VERSION = '3.0.
|
| 91 |
const MIN_PHP = 5.6;
|
| 92 |
|
| 93 |
// Arrays to hold configurations for LatAm environment.
|
| 3 |
* Plugin Name: WooCommerce MercadoPago
|
| 4 |
* Plugin URI: https://github.com/mercadopago/cart-woocommerce
|
| 5 |
* Description: This is the <strong>oficial</strong> module of Mercado Pago for WooCommerce plugin. This module enables WooCommerce to use Mercado Pago as a payment Gateway for purchases made in your e-commerce store.
|
| 6 |
+
* Version: 3.0.4
|
| 7 |
* Author: Mercado Pago
|
| 8 |
* Author URI: https://www.mercadopago.com.br/developers/
|
| 9 |
* Text Domain: woocommerce-mercadopago
|
| 87 |
// ============================================================
|
| 88 |
|
| 89 |
// General constants.
|
| 90 |
+
const VERSION = '3.0.4';
|
| 91 |
const MIN_PHP = 5.6;
|
| 92 |
|
| 93 |
// Arrays to hold configurations for LatAm environment.
|
