Skip to content

Commit

Permalink
Merge pull request #411 from ebanx/release/1.10.0
Browse files Browse the repository at this point in the history
Release/1.10.0
  • Loading branch information
Cezar Luiz authored Mar 29, 2017
2 parents 5f8e7ff + 3474d18 commit bb074c7
Show file tree
Hide file tree
Showing 34 changed files with 71 additions and 73 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

# 1.10.0
* Feature - Removed restriction on guest users for sandbox mode [#406](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/406)
* Feature - Showing some EBANX order details on admin order details page [#404](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/404)
* Improvement - Removed unecessary properties and variables [#407](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/407)
* Improvement - Improved texts and options on OXXO thank you page [#409](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/409)
* Fix - Updated deprecated function [#403](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/403)


# 1.9.1
* Fix - Fixed translations string keys in instalment template [#402](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/402)

Expand Down
5 changes: 1 addition & 4 deletions woocommerce-gateway-ebanx/assets/css/paying-via-ebanx.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ li[class*="ebanx"] .ebanx-payment-container.ebanx-language-br:after {
background-image: url(../images/ebanx-pagando.png);
}

li[class*="ebanx"] .ebanx-payment-container.ebanx-language-mx:after,
li[class*="ebanx"] .ebanx-payment-container.ebanx-language-pe:after,
li[class*="ebanx"] .ebanx-payment-container.ebanx-language-co:after,
li[class*="ebanx"] .ebanx-payment-container.ebanx-language-cl:after {
li[class*="ebanx"] .ebanx-payment-container.ebanx-language-es:after {
width: 168px;

background-image: url(../images/ebanx-estas-pagando.png);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ public function payment_fields()

wc_get_template(
'account/payment-form.php',
array(
'language' => $this->language,
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public function payment_fields()

wc_get_template(
'baloto/payment-form.php',
array(
'language' => $this->language,
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public function payment_fields()

wc_get_template(
'banking-ticket/checkout-instructions.php',
array(
'language' => $this->language,
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public function payment_fields() {
wc_get_template(
'ebanx-credit-card-br/payment-form.php',
array(
'language' => $this->language,
'cards' => (array) $cards,
'cart_total' => $cart_total,
'max_installment' => min($this->configs->settings['credit_card_instalments'], $max_instalments),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public function payment_fields() {
wc_get_template(
'ebanx-credit-card-mx/payment-form.php',
array(
'language' => $this->language,
'cards' => (array) $cards,
'cart_total' => $cart_total,
'country' => $this->getTransactionAddress('country'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function payment_fields()
wc_get_template(
'debit-card/payment-form.php',
array(
'language' => $this->language,
'cart_total' => $this->get_order_total()
),
'woocommerce/ebanx/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function payment_fields()
wc_get_template(
'eft/payment-form.php',
array(
'language' => $this->language,
'title' => $this->title,
'description' => $this->description,
'banks' => WC_EBANX_Gateway_Utils::$BANKS_EFT_ALLOWED[WC_EBANX_Gateway_Utils::COUNTRY_COLOMBIA]
Expand Down
23 changes: 12 additions & 11 deletions woocommerce-gateway-ebanx/includes/class-wc-ebanx-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ public function is_available()

$this->language = $this->getTransactionAddress('country');

if ($this->is_sandbox_mode && !current_user_can('administrator')) {
return false;
};

return parent::is_available() && !empty($this->public_key) && !empty($this->private_key) && $this->enabled === 'yes' && ($this->currency_is_usd_eur($currency) || $this->ebanx_process_merchant_currency($currency));
return parent::is_available()
&& $this->enabled === 'yes'
&& !empty($this->public_key)
&& !empty($this->private_key)
&& ($this->currency_is_usd_eur($currency)
|| $this->ebanx_process_merchant_currency($currency)
);
}

/**
Expand Down Expand Up @@ -450,8 +452,7 @@ protected function request_data($order)
'payment' => array(
'notification_url' => $home_url,
'redirect_url' => $home_url,
'user_value_1' => 'name=plugin',
'user_value_2' => 'value=woocommerce',
'user_value_1' => 'from_woocommerce',
'user_value_3' => 'version=' . WC_EBANX::VERSION,
'country' => $order->billing_country,
'currency_code' => $this->merchant_currency,
Expand Down Expand Up @@ -608,14 +609,14 @@ protected function request_data($order)
*/
protected function getTransactionAddress($attr = '')
{
if (empty(WC()->customer) || is_admin() || (empty($_POST['billing_country']) && empty(WC()->customer->get_country()))) {
if (empty(WC()->customer) || is_admin() || (empty($_POST['billing_country']) && empty(WC()->customer->get_billing_country()))) {
return false;
}

if (!empty($_POST['billing_country'])) {
$this->address['country'] = trim(strtolower($_POST['billing_country']));
} else {
$this->address['country'] = trim(strtolower(WC()->customer->get_country()));
$this->address['country'] = trim(strtolower(WC()->customer->get_billing_country()));
}

if ($attr !== '' && !empty($this->address[$attr])) {
Expand Down Expand Up @@ -662,7 +663,7 @@ public function process_payment($order_id)
));
} catch (Exception $e) {

$this->language = $this->getTransactionAddress('country');
$country = $this->getTransactionAddress('country');

$code = $e->getMessage();

Expand All @@ -673,7 +674,7 @@ public function process_payment($order_id)
'co' => 'es',
'br' => 'pt-br',
);
$language = $languages[$this->language];
$language = $languages[$country];

$errors = array(
'pt-br' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ final class WC_EBANX_Global_Gateway extends WC_Payment_Gateway
* @var array
*/
public static $defaults = array(
'sandbox_mode_enabled' => 'yes',
'sandbox_private_key' => '',
'sandbox_public_key' => '',
'sandbox_mode_enabled' => 'yes',
'debug_enabled' => 'yes',
'brazil_payment_methods' => array(
'ebanx-credit-card-br',
Expand Down Expand Up @@ -130,9 +130,8 @@ public function init_form_fields()
'title' => __('EBANX Sandbox', 'woocommerce-gateway-ebanx'),
'type' => 'checkbox',
'label' => __('Enable Sandbox Mode', 'woocommerce-gateway-ebanx'),
'description' => __('EBANX Sandbox is a testing environment that mimics the live environment. Use it to make payment requests to see how your ecommerce processes them.'),
'desc_tip' => true,
'default' => 'yes',
'description' => __('EBANX Sandbox is a testing environment that mimics the live environment. Use it to make payment requests to see how your ecommerce processes them.', 'woocommerce-gateway-ebanx'),
'desc_tip' => true
),
'debug_enabled' => array(
'title' => __('Debug Log', 'woocommerce-gateway-ebanx'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public function payment_fields()

wc_get_template(
'oxxo/payment-form.php',
array(
'language' => $this->language,
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand All @@ -73,6 +71,7 @@ protected function save_order_meta_fields($order, $request)
parent::save_order_meta_fields($order, $request);

update_post_meta($order->id, '_oxxo_url', $request->payment->oxxo_url);
update_post_meta($order->id, '_payment_due_date', $request->payment->due_date);
}

/**
Expand All @@ -89,14 +88,18 @@ public static function thankyou_page($order)
$oxxo_print = $oxxo_url . "&format=print";
$customer_email = get_post_meta($order->id, '_ebanx_payment_customer_email', true);
$oxxo_hash = get_post_meta($order->id, '_ebanx_payment_hash', true);
$customer_name = $order->billing_first_name;
$oxxo_due_date = get_post_meta($order->id, '_payment_due_date', true);

$data = array(
'data' => array(
'url_basic' => $oxxo_basic,
'url_pdf' => $oxxo_pdf,
'url_print' => $oxxo_print,
'url_iframe' => get_site_url() . '/?ebanx=order-received&hash=' . $oxxo_hash . '&payment_type=oxxo',
'customer_email' => $customer_email
'customer_email' => $customer_email,
'customer_name' => $customer_name,
'due_date' => $oxxo_due_date
),
'order_status' => $order->get_status(),
'method' => 'oxxo'
Expand Down Expand Up @@ -133,7 +136,6 @@ protected function request_data($order)
}*/

$data = parent::request_data($order);

$data['payment']['payment_type_code'] = $this->api_name;

return $data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public function payment_fields()

wc_get_template(
'pagoefectivo/payment-form.php',
array(
'language' => $this->language,
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function payment_fields()
wc_get_template(
'safetypay/payment-form.php',
array(
'language' => $this->language,
'title' => $this->title,
'description' => $this->description,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ public function payment_fields()

wc_get_template(
'sencillito/payment-form.php',
array(
'language' => $this->language
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public function payment_fields()

wc_get_template(
'servipag/payment-form.php',
array(
'language' => $this->language,
),
array(),
'woocommerce/ebanx/',
WC_EBANX::get_templates_path()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public function payment_fields()
wc_get_template(
'tef/payment-form.php',
array(
'language' => $this->language,
'title' => $this->title,
'description' => $this->description,
),
Expand Down
9 changes: 8 additions & 1 deletion woocommerce-gateway-ebanx/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: ebanxwp
Tags: credit card, boleto, ebanx, woocommerce, approval rate, conversion rate, brazil, mexico, peru, colombia, chile, oxxo, baloto, cash payment, local payment one-click payment, installments, alternative payments, accept more payments
Requires at least: 4.0
Tested up to: 4.7
Stable tag: 1.9.1
Stable tag: 1.10.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -136,6 +136,13 @@ Yes, you can.

== Changelog ==

= 1.10.0 =
* Feature - Removed restriction on guest users for sandbox mode [#406](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/406)
* Feature - Showing some EBANX order details on admin order details page [#404](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/404)
* Improvement - Removed unecessary properties and variables [#407](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/407)
* Improvement - Improved texts and options on OXXO thank you page [#409](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/409)
* Fix - Updated deprecated function [#403](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/403)

= 1.9.1 =
* Fix - Fixed translations string keys in instalment template [#402](https://github.com/ebanx/woocommerce-gateway-ebanx/pull/402)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
?>

<div id="ebanx-account" class="ebanx-payment-container ebanx-language-<?php echo $language ?>"></div>
<div id="ebanx-account" class="ebanx-payment-container ebanx-language-br"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
}
?>

<div id="ebanx-baloto-payment" class="ebanx-payment-container ebanx-language-<?php echo $language ?>"></div>
<div id="ebanx-baloto-payment" class="ebanx-payment-container ebanx-language-es"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
?>

<div id="ebanx-banking-ticket" class="ebanx-payment-container ebanx-language-<?php echo $language ?>"></div>
<div id="ebanx-banking-ticket" class="ebanx-payment-container ebanx-language-br"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}
?>

<div id="ebanx-debit-cart-form" class="ebanx-payment-container ebanx-language-<?php echo $language ?>">
<div id="ebanx-debit-cart-form" class="ebanx-payment-container ebanx-language-es">
<div id="ebanx-container-new-debit-card">
<section class="ebanx-form-row">
<label for="ebanx-debit-card-holder-name"><?php _e('Titular de la tarjeta', 'woocommerce-gateway-ebanx') ?> <span class="required">*</span></label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
?>

<div id="ebanx-credit-cart-form" class="ebanx-payment-container ebanx-language-<?php echo $language ?>">
<div id="ebanx-credit-cart-form" class="ebanx-payment-container ebanx-language-br">
<section class="ebanx-form-row">
<?php if (!empty($cards)): ?>
<?php foreach ($cards as $k => $card): ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="ebanx-credit-card-template ebanx-language-<?php echo $language ?>">
<div class="ebanx-credit-card-template ebanx-language-es">
<section class="ebanx-form-row">
<label for="ebanx-card-holder-name"><?php _e('Titular de la tarjeta', 'woocommerce-gateway-ebanx'); ?><span class="required">*</span></label>
<input id="ebanx-card-holder-name" class="wc-credit-card-form-card-name input-text" type="text" autocomplete="off" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
?>

<div id="ebanx-credit-cart-form" class="ebanx-payment-container ebanx-language-<?php echo $language ?>">
<div id="ebanx-credit-cart-form" class="ebanx-payment-container ebanx-language-es">
<section class="ebanx-form-row">
<?php if (!empty($cards)): ?>
<?php foreach ($cards as $k => $card): ?>
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-gateway-ebanx/templates/eft/payment-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
asort($banks);
?>

<div id="ebanx-eft-payment" class="ebanx-payment-container ebanx-language-<?php echo $language ?>">
<div id="ebanx-eft-payment" class="ebanx-payment-container ebanx-language-es">
<select name="eft" class="ebanx-select-field">
<?php foreach($banks as $key => $bank): ?>
<option value="<?php echo $key ?>"><?php echo $bank ?></option>
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-gateway-ebanx/templates/oxxo/payment-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
?>

<div id="ebanx-oxxo-payment" class="ebanx-payment-container ebanx-language-<?php echo $language ?>"></div>
<div id="ebanx-oxxo-payment" class="ebanx-payment-container ebanx-language-es"></div>
7 changes: 4 additions & 3 deletions woocommerce-gateway-ebanx/templates/oxxo/payment-on-hold.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

<hr>
<div class="banking-ticket__desc">
<p class="woocommerce-thankyou-order-received">Su boleta OXXO fue generado con éxito.</p>
<p>Una copia de la boleta fue enviada al correo electrónico <strong><?=$customer_email ?></strong>.</p>
<p>Si tienes dudas, por favor escribe a <a href="mailto:[email protected]">[email protected]</a>.</p>
<p class="woocommerce-thankyou-order-received">¡Listo <?php echo $customer_name ?>! Tu boleta EBANX de pago en OXXO ha sido generada.</p>
<p>Enviamos una copia a <strong><?php echo $customer_email ?></strong>.</p>
<p>No lo olvides: tu boleta vence el día <strong><?php echo date_i18n('d/m', strtotime($due_date)) ?></strong>. Después de esa fecha no será posible realizar el pago y la boleta será cancelada automáticamente.</p>
<p>¿Dudas? Con gusto te <a href="https://www.ebanx.com/mx/ayuda/pagos/boleta" target="_blank">ayudaremos</a>.</p>
</div>

<hr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
?>

<div id="ebanx-pagoefectivo-payment" class="ebanx-payment-container ebanx-language-<?php echo $language ?>"></div>
<div id="ebanx-pagoefectivo-payment" class="ebanx-payment-container ebanx-language-es"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
?>

<div id="ebanx-safetypay-payment" class="ebanx-payment-container ebanx-language-<?php echo $language ?>">
<div id="ebanx-safetypay-payment" class="ebanx-payment-container ebanx-language-es">
<div class="ebanx-form-row">
<label class="ebanx-label">
<input type="radio" name="safetypay" value="cash" checked> Cash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
}
?>

<div id="ebanx-sencillito" class="ebanx-payment-container ebanx-language-<?php echo $language ?>"></div>
<div id="ebanx-sencillito" class="ebanx-payment-container ebanx-language-es"></div>
Loading

0 comments on commit bb074c7

Please sign in to comment.