@@ -2,7 +2,7 @@ |
||
| 2 | 2 | <div class="paylater-content"> |
| 3 | 3 | <div id="myModal" class="paylater_modal" style="display: block;"> |
| 4 | 4 | <div class="paylater_modal-content"> |
| 5 | - <iframe id="iframe-pagantis" name="iframe-pagantis" style="width: 100%; height: 100%; display: block" frameborder="0" src="<?php echo $url;?>"> |
|
| 5 | + <iframe id="iframe-pagantis" name="iframe-pagantis" style="width: 100%; height: 100%; display: block" frameborder="0" src="<?php echo $url; ?>"> |
|
| 6 | 6 | </iframe> |
| 7 | 7 | <button class="paylater_modal-close" id="paylater_close" title="Cerrar" type="button">X</button> |
| 8 | 8 | </div> |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | <?php } ?> |
| 4 | 4 | |
| 5 | 5 | <?php |
| 6 | -if ($enabled!=='0'&& isset($total)) { ?> |
|
| 6 | +if ($enabled!=='0' && isset($total)) { ?> |
|
| 7 | 7 | <span class="js-pmt-payment-type"></span> |
| 8 | 8 | <div class="PmtSimulator" style="width: max-content" |
| 9 | - data-pmt-num-quota="<?php echo $min_installments;?>" data-pmt-max-ins="<?php echo $max_installments;?>" |
|
| 9 | + data-pmt-num-quota="<?php echo $min_installments; ?>" data-pmt-max-ins="<?php echo $max_installments; ?>" |
|
| 10 | 10 | data-pmt-style="blue" data-pmt-type="<?php echo $enabled; ?>" data-pmt-discount="0" |
| 11 | 11 | data-pmt-amount="<?php echo $total; ?>" data-pmt-expanded="no"> |
| 12 | 12 | </div> |
@@ -26,14 +26,14 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct() |
| 28 | 28 | { |
| 29 | - $this->template_path = plugin_dir_path(__FILE__) . '/templates/'; |
|
| 29 | + $this->template_path = plugin_dir_path(__FILE__).'/templates/'; |
|
| 30 | 30 | |
| 31 | 31 | load_plugin_textdomain('paylater', false, basename(dirname(__FILE__)).'/languages'); |
| 32 | 32 | add_filter('woocommerce_payment_gateways', array($this, 'addPaylaterGateway')); |
| 33 | 33 | add_filter('woocommerce_available_payment_gateways', array($this, 'paylaterFilterGateways'), 9999); |
| 34 | - add_filter('plugin_row_meta', array($this,'paylaterRowMeta'), 10, 2); |
|
| 35 | - add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this,'paylaterActionLinks')); |
|
| 36 | - add_action('woocommerce_after_add_to_cart_form', array( $this, 'paylaterAddProductSimulator')); |
|
| 34 | + add_filter('plugin_row_meta', array($this, 'paylaterRowMeta'), 10, 2); |
|
| 35 | + add_filter('plugin_action_links_'.plugin_basename(__FILE__), array($this, 'paylaterActionLinks')); |
|
| 36 | + add_action('woocommerce_after_add_to_cart_form', array($this, 'paylaterAddProductSimulator')); |
|
| 37 | 37 | add_action('wp_enqueue_scripts', 'add_widget_js'); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function paylaterActionLinks($links) |
| 98 | 98 | { |
| 99 | - $params_array = array('page'=>'wc-settings','tab'=>'checkout','section'=>'paylater'); |
|
| 99 | + $params_array = array('page'=>'wc-settings', 'tab'=>'checkout', 'section'=>'paylater'); |
|
| 100 | 100 | $setting_url = esc_url(add_query_arg($params_array, admin_url('admin.php?'))); |
| 101 | 101 | $setting_link = '<a href="'.$setting_url.'">'.__('Ajustes', 'paylater').'</a>'; |
| 102 | 102 | |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function paylaterRowMeta($links, $file) |
| 116 | 116 | { |
| 117 | - if ($file == plugin_basename(__FILE__)) { |
|
| 118 | - $links[]='<a href="'.WcPaylater::GIT_HUB_URL.'" target="_blank">'.__('Documentación', 'paylater').'</a>'; |
|
| 119 | - $links[]='<a href="'.WcPaylater::PMT_DOC_URL.'" target="_blank">'.__('Documentación de la API', 'paylater').'</a>'; |
|
| 120 | - $links[]='<a href="'.WcPaylater::SUPPORT_EML.'">'.__('Soporte', 'paylater').'</a>'; |
|
| 117 | + if ($file==plugin_basename(__FILE__)) { |
|
| 118 | + $links[] = '<a href="'.WcPaylater::GIT_HUB_URL.'" target="_blank">'.__('Documentación', 'paylater').'</a>'; |
|
| 119 | + $links[] = '<a href="'.WcPaylater::PMT_DOC_URL.'" target="_blank">'.__('Documentación de la API', 'paylater').'</a>'; |
|
| 120 | + $links[] = '<a href="'.WcPaylater::SUPPORT_EML.'">'.__('Soporte', 'paylater').'</a>'; |
|
| 121 | 121 | return $links; |
| 122 | 122 | } |
| 123 | 123 | return $links; |
@@ -29,29 +29,29 @@ discard block |
||
| 29 | 29 | $this->title = WcPaylaterGateway::METHOD_TITLE; |
| 30 | 30 | |
| 31 | 31 | //Useful vars |
| 32 | - $this->template_path = plugin_dir_path(__FILE__) . '../templates/'; |
|
| 32 | + $this->template_path = plugin_dir_path(__FILE__).'../templates/'; |
|
| 33 | 33 | $this->allowed_currencies = array("EUR");
|
| 34 | 34 | $this->allowed_languages = array("es_ES");
|
| 35 | - $this->mainFileLocation = dirname(plugin_dir_path(__FILE__)) . '/WC_Paylater.php'; |
|
| 35 | + $this->mainFileLocation = dirname(plugin_dir_path(__FILE__)).'/WC_Paylater.php'; |
|
| 36 | 36 | $this->plugin_info = get_file_data($this->mainFileLocation, array('Version' => 'Version'), false);
|
| 37 | 37 | |
| 38 | 38 | //Panel form fields |
| 39 | - $this->form_fields = include(plugin_dir_path(__FILE__).'../includes/settings-paylater.php');//Panel options |
|
| 39 | + $this->form_fields = include(plugin_dir_path(__FILE__).'../includes/settings-paylater.php'); //Panel options |
|
| 40 | 40 | $this->init_settings(); |
| 41 | 41 | |
| 42 | - $this->settings['ok_url'] = ($this->settings['ok_url']!='')?$this->settings['ok_url']:$this->generateOkUrl(); |
|
| 43 | - $this->settings['ko_url'] = ($this->settings['ko_url']!='')?$this->settings['ko_url']:$this->generateKoUrl(); |
|
| 42 | + $this->settings['ok_url'] = ($this->settings['ok_url']!='') ? $this->settings['ok_url'] : $this->generateOkUrl(); |
|
| 43 | + $this->settings['ko_url'] = ($this->settings['ko_url']!='') ? $this->settings['ko_url'] : $this->generateKoUrl(); |
|
| 44 | 44 | foreach ($this->settings as $setting_key => $setting_value) {
|
| 45 | 45 | $this->$setting_key = $setting_value; |
| 46 | 46 | } |
| 47 | 47 | $this->method_description = $this->checkout_title; |
| 48 | 48 | |
| 49 | 49 | //Hooks |
| 50 | - add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this,'process_admin_options')); //Save plugin options
|
|
| 51 | - add_action('admin_notices', array($this, 'paylaterCheckFields')); //Check config fields
|
|
| 52 | - add_action('woocommerce_receipt_'.$this->id, array($this, 'paylaterReceiptPage')); //Pmt form
|
|
| 53 | - add_action('woocommerce_api_wcpaylatergateway', array($this, 'paylaterNotification')); //Json Notification
|
|
| 54 | - add_filter('woocommerce_payment_complete_order_status', array($this,'paylaterCompleteStatus'), 10, 3);
|
|
| 50 | + add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this, 'process_admin_options')); //Save plugin options
|
|
| 51 | + add_action('admin_notices', array($this, 'paylaterCheckFields')); //Check config fields
|
|
| 52 | + add_action('woocommerce_receipt_'.$this->id, array($this, 'paylaterReceiptPage')); //Pmt form
|
|
| 53 | + add_action('woocommerce_api_wcpaylatergateway', array($this, 'paylaterNotification')); //Json Notification
|
|
| 54 | + add_filter('woocommerce_payment_complete_order_status', array($this, 'paylaterCompleteStatus'), 10, 3);
|
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /*********** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $template_fields = array( |
| 69 | 69 | 'panel_header' => $this->title, |
| 70 | 70 | 'panel_description' => $this->method_description, |
| 71 | - 'button1_label' => __('Login al panel de ', 'paylater') . WcPaylaterGateway::METHOD_TITLE,
|
|
| 71 | + 'button1_label' => __('Login al panel de ', 'paylater').WcPaylaterGateway::METHOD_TITLE,
|
|
| 72 | 72 | 'button2_label' => __('Documentación', 'paylater'),
|
| 73 | 73 | 'logo' => $this->icon, |
| 74 | 74 | 'settings' => $this->generate_settings_html($this->form_fields, false) |
@@ -82,29 +82,29 @@ discard block |
||
| 82 | 82 | public function paylaterCheckFields() |
| 83 | 83 | {
|
| 84 | 84 | $error_string = ''; |
| 85 | - if ($this->settings['enabled'] !== 'yes') {
|
|
| 85 | + if ($this->settings['enabled']!=='yes') {
|
|
| 86 | 86 | return; |
| 87 | 87 | } elseif (!version_compare(phpversion(), '5.3.0', '>=')) {
|
| 88 | - $error_string = __(' no es compatible con su versión de php y/o curl', 'paylater');
|
|
| 88 | + $error_string = __(' no es compatible con su versión de php y/o curl', 'paylater');
|
|
| 89 | 89 | $this->settings['enabled'] = 'no'; |
| 90 | 90 | } elseif ($this->settings['public_key']=="" || $this->settings['secret_key']=="") {
|
| 91 | - $keys_error = <<<EOD |
|
| 91 | + $keys_error = <<<EOD |
|
| 92 | 92 | no está configurado correctamente, los campos Public Key y Secret Key son obligatorios para su funcionamiento |
| 93 | 93 | EOD; |
| 94 | 94 | $error_string = __($keys_error, 'paylater'); |
| 95 | 95 | $this->settings['enabled'] = 'no'; |
| 96 | 96 | } elseif (!in_array(get_woocommerce_currency(), $this->allowed_currencies)) {
|
| 97 | - $error_string = __(' solo puede ser usado en Euros', 'paylater');
|
|
| 97 | + $error_string = __(' solo puede ser usado en Euros', 'paylater');
|
|
| 98 | 98 | $this->settings['enabled'] = 'no'; |
| 99 | 99 | } elseif (!in_array(get_locale(), $this->allowed_languages)) {
|
| 100 | 100 | $error_string = __(' solo puede ser usado en Español', 'paylater');
|
| 101 | 101 | $this->settings['enabled'] = 'no'; |
| 102 | - } elseif ($this->min_installments<2 || $this->min_installments>12 || |
|
| 103 | - $this->max_installments<2 || $this->max_installments>12 ) {
|
|
| 102 | + } elseif ($this->min_installments < 2 || $this->min_installments > 12 || |
|
| 103 | + $this->max_installments < 2 || $this->max_installments > 12) {
|
|
| 104 | 104 | $error_string = __(' solo puede ser pagado de 2 a 12 plazos.', 'paylater');
|
| 105 | 105 | $this->settings['min_installments'] = 2; |
| 106 | 106 | $this->settings['max_installments'] = 12; |
| 107 | - } elseif ($this->min_amount<0 || $this->max_amount<0) {
|
|
| 107 | + } elseif ($this->min_amount < 0 || $this->max_amount < 0) {
|
|
| 108 | 108 | $error_string = __(' el importe debe ser mayor a 0.', 'paylater');
|
| 109 | 109 | $this->settings['min_amount'] = 0; |
| 110 | 110 | $this->settings['max_amount'] = 10000; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | if ($error_string!='') {
|
| 114 | 114 | $template_fields = array( |
| 115 | - 'error_msg' => WcPaylaterGateway::METHOD_TITLE .' '.$error_string, |
|
| 115 | + 'error_msg' => WcPaylaterGateway::METHOD_TITLE.' '.$error_string, |
|
| 116 | 116 | ); |
| 117 | 117 | wc_get_template('error_msg.php', $template_fields, '', $this->template_path);
|
| 118 | 118 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $currency = $order->get_currency(); |
| 143 | 143 | $cancelUrl = $this->getKoUrl($order); |
| 144 | - $include_simulator = ($this->simulator_checkout !== '0') ? '1' : '0'; |
|
| 144 | + $include_simulator = ($this->simulator_checkout!=='0') ? '1' : '0'; |
|
| 145 | 145 | $callback_arg = array( |
| 146 | 146 | 'wc-api'=>'wcpaylatergateway', |
| 147 | 147 | 'key'=>$order->get_order_key(), |
@@ -159,20 +159,20 @@ discard block |
||
| 159 | 159 | $is_guest = "false"; |
| 160 | 160 | $sign_up = substr($current_user->user_registered, 0, 10); |
| 161 | 161 | $customer_orders = get_posts(array( |
| 162 | - 'numberposts' => - 1, |
|
| 162 | + 'numberposts' => -1, |
|
| 163 | 163 | 'meta_key' => '_customer_user', |
| 164 | 164 | 'meta_value' => $current_user->ID, |
| 165 | - 'post_type' => array( 'shop_order' ), |
|
| 166 | - 'post_status' => array( 'wc-completed', 'wc-processing', 'wc-refunded' ), |
|
| 165 | + 'post_type' => array('shop_order'),
|
|
| 166 | + 'post_status' => array('wc-completed', 'wc-processing', 'wc-refunded'),
|
|
| 167 | 167 | )); |
| 168 | 168 | } else {
|
| 169 | 169 | $is_guest = "true"; |
| 170 | 170 | $customer_orders = get_posts(array( |
| 171 | - 'numberposts' => - 1, |
|
| 171 | + 'numberposts' => -1, |
|
| 172 | 172 | 'meta_key' => '_billing_email', |
| 173 | 173 | 'meta_value' => $order->billing_email, |
| 174 | - 'post_type' => array( 'shop_order' ), |
|
| 175 | - 'post_status' => array( 'wc-completed', 'wc-processing', 'wc-refunded'), |
|
| 174 | + 'post_type' => array('shop_order'),
|
|
| 175 | + 'post_status' => array('wc-completed', 'wc-processing', 'wc-refunded'),
|
|
| 176 | 176 | )); |
| 177 | 177 | foreach ($customer_orders as $customer_order) {
|
| 178 | 178 | if (trim($sign_up)=='' || |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $total_orders++; |
| 188 | 188 | $tmp_order = wc_get_order($customer_order); |
| 189 | 189 | $refund_amt += $tmp_order->get_total_refunded(); |
| 190 | - if ($tmp_order->get_total_refunded() != null) {
|
|
| 190 | + if ($tmp_order->get_total_refunded()!=null) {
|
|
| 191 | 191 | if ($tmp_order->get_total_refunded() >= $order->get_total()) {
|
| 192 | 192 | $total_refunds++; |
| 193 | 193 | } else {
|
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | if ($url=="") {
|
| 243 | 243 | throw new Exception(_("No ha sido posible obtener una respuesta de PagaMasTarde"));
|
| 244 | - } elseif ($this->iframe !== 'true') {
|
|
| 244 | + } elseif ($this->iframe!=='true') {
|
|
| 245 | 245 | wp_redirect($url); |
| 246 | 246 | exit; |
| 247 | 247 | } else {
|
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | wc_get_template('iframe.php', $template_fields, '', $this->template_path);
|
| 256 | 256 | } |
| 257 | 257 | } catch (Exception $e) {
|
| 258 | - wc_add_notice(__('Error en el pago - ', 'paylater') . $e->getMessage(), 'error');
|
|
| 258 | + wc_add_notice(__('Error en el pago - ', 'paylater').$e->getMessage(), 'error');
|
|
| 259 | 259 | $checkout_url = get_permalink(wc_get_page_id('checkout'));
|
| 260 | 260 | wp_redirect($checkout_url); |
| 261 | 261 | exit; |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | {
|
| 270 | 270 | try {
|
| 271 | 271 | $order_id = $_GET['order-received']; |
| 272 | - $origin = ($_SERVER['REQUEST_METHOD'] == 'POST') ? 'Notify' : 'Order'; |
|
| 272 | + $origin = ($_SERVER['REQUEST_METHOD']=='POST') ? 'Notify' : 'Order'; |
|
| 273 | 273 | |
| 274 | 274 | include_once('notifyController.php');
|
| 275 | 275 | $notify = new WcPaylaterNotify(); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $result['notification_error'] = true; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
| 285 | + if ($_SERVER['REQUEST_METHOD']=='POST') {
|
|
| 286 | 286 | $response = json_encode(array( |
| 287 | 287 | 'timestamp' => time(), |
| 288 | 288 | 'order_id' => $order_id, |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | header('HTTP/1.1 200 Ok', true, 200);
|
| 297 | 297 | } |
| 298 | 298 | header('Content-Type: application/json', true);
|
| 299 | - header('Content-Length: ' . strlen($response));
|
|
| 299 | + header('Content-Length: '.strlen($response));
|
|
| 300 | 300 | echo ($response); |
| 301 | 301 | exit(); |
| 302 | 302 | } else {
|
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | */ |
| 317 | 317 | public function paylaterCompleteStatus($status, $order_id, $order) |
| 318 | 318 | {
|
| 319 | - if ($order->get_payment_method() == WcPaylaterGateway::METHOD_ID && $order->get_status() == 'failed') {
|
|
| 319 | + if ($order->get_payment_method()==WcPaylaterGateway::METHOD_ID && $order->get_status()=='failed') {
|
|
| 320 | 320 | $status = 'processing'; |
| 321 | 321 | } |
| 322 | 322 | |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | public function is_available() |
| 337 | 337 | {
|
| 338 | 338 | if ($this->enabled==='yes' && $this->public_key!='' && $this->secret_key!='' && |
| 339 | - $this->get_order_total()>$this->min_amount && $this->get_order_total()<$this->max_amount) {
|
|
| 339 | + $this->get_order_total() > $this->min_amount && $this->get_order_total() < $this->max_amount) {
|
|
| 340 | 340 | return true; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | 'redirect' => $order->get_checkout_payment_url(true) //paylaterReceiptPage function |
| 368 | 368 | ); |
| 369 | 369 | } catch (Exception $e) {
|
| 370 | - wc_add_notice(__('Error en el pago ', 'paylater') . $e->getMessage(), 'error');
|
|
| 370 | + wc_add_notice(__('Error en el pago ', 'paylater').$e->getMessage(), 'error');
|
|
| 371 | 371 | return array(); |
| 372 | 372 | } |
| 373 | 373 | } |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | private function generateUrl($url) |
| 421 | 421 | {
|
| 422 | 422 | $parsed_url = parse_url($url); |
| 423 | - if ($parsed_url !== false) {
|
|
| 423 | + if ($parsed_url!==false) {
|
|
| 424 | 424 | $parsed_url['query'] = !isset($parsed_url['query']) ? '' : $parsed_url['query']; |
| 425 | 425 | parse_str($parsed_url['query'], $arrayParams); |
| 426 | 426 | foreach ($arrayParams as $keyParam => $valueParam) {
|
@@ -468,11 +468,10 @@ discard block |
||
| 468 | 468 | private function getKeysUrl($order, $url) |
| 469 | 469 | {
|
| 470 | 470 | $defaultFields = (get_class($order)=='WC_Order') ? |
| 471 | - array('order-received'=>$order->get_id(), 'key'=>$order->get_order_key()) :
|
|
| 472 | - array(); |
|
| 471 | + array('order-received'=>$order->get_id(), 'key'=>$order->get_order_key()) : array();
|
|
| 473 | 472 | |
| 474 | 473 | $parsedUrl = parse_url($url); |
| 475 | - if ($parsedUrl !== false) {
|
|
| 474 | + if ($parsedUrl!==false) {
|
|
| 476 | 475 | //Replace parameters from url |
| 477 | 476 | $parsedUrl['query'] = $this->getKeysParametersUrl($parsedUrl['query'], $defaultFields); |
| 478 | 477 | |
@@ -517,7 +516,7 @@ discard block |
||
| 517 | 516 | foreach ($arrayParams as $keyParam => $valueParam) {
|
| 518 | 517 | preg_match('#\{{.*?}\}#', $valueParam, $match);
|
| 519 | 518 | if (count($match)) {
|
| 520 | - $key = str_replace(array('{{','}}'), array('',''), $match[0]);
|
|
| 519 | + $key = str_replace(array('{{', '}}'), array('', ''), $match[0]);
|
|
| 521 | 520 | $arrayParams[$keyParam] = $defaultFields[$key]; |
| 522 | 521 | } |
| 523 | 522 | } |
@@ -532,12 +531,12 @@ discard block |
||
| 532 | 531 | */ |
| 533 | 532 | private function unparseUrl($parsed_url) |
| 534 | 533 | {
|
| 535 | - $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; |
|
| 534 | + $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'].'://' : ''; |
|
| 536 | 535 | $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; |
| 537 | - $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : ''; |
|
| 538 | - $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; |
|
| 539 | - $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; |
|
| 536 | + $port = isset($parsed_url['port']) ? ':'.$parsed_url['port'] : ''; |
|
| 537 | + $query = isset($parsed_url['query']) ? '?'.$parsed_url['query'] : ''; |
|
| 538 | + $fragment = isset($parsed_url['fragment']) ? '#'.$parsed_url['fragment'] : ''; |
|
| 540 | 539 | $path = $parsed_url['path']; |
| 541 | - return $scheme . $host . $port . $path . $query . $fragment; |
|
| 540 | + return $scheme.$host.$port.$path.$query.$fragment; |
|
| 542 | 541 | } |
| 543 | 542 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | {
|
| 64 | 64 | require_once(__ROOT__.'/vendor/autoload.php'); |
| 65 | 65 | global $woocommerce; |
| 66 | - $result = array('notification_error'=>true,'notification_message'=>'No se ha podido confirmar el pago');
|
|
| 66 | + $result = array('notification_error'=>true, 'notification_message'=>'No se ha podido confirmar el pago');
|
|
| 67 | 67 | if (!$this->getOrder()->get_id()) {
|
| 68 | 68 | $result['notification_message'] = 'La orden no existe en esta tienda'; |
| 69 | 69 | $result['notification_error'] = false; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $payments = $pmtClient->charge()->getChargesByOrderId($this->getOrder()->get_id()); |
| 91 | 91 | $latestCharge = array_shift($payments); |
| 92 | 92 | $pmtAmount = $latestCharge->getAmount(); |
| 93 | - if ($pmtAmount == (intval(100 * $order->get_total()))) {
|
|
| 93 | + if ($pmtAmount==(intval(100 * $order->get_total()))) {
|
|
| 94 | 94 | $paymentResult = $order->payment_complete(); |
| 95 | 95 | if ($paymentResult) {
|
| 96 | 96 | $order->add_order_note($this->origin); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <br/> |
| 2 | 2 | <span class="js-pmt-payment-type"></span> |
| 3 | 3 | <div class="PmtSimulator" style="display:none" |
| 4 | - data-pmt-num-quota="<?php echo $settings['min_installments'] ; ?>" |
|
| 4 | + data-pmt-num-quota="<?php echo $settings['min_installments']; ?>" |
|
| 5 | 5 | data-pmt-max-ins="<?php echo $settings['max_installments']; ?>" data-pmt-style="blue" |
| 6 | 6 | data-pmt-type="<?php echo $settings['simulator_product']; ?>" |
| 7 | 7 | data-pmt-discount="0" data-pmt-amount="" |
@@ -53,17 +53,17 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // CONFIG VARS |
| 56 | -var min_amount = '<?php echo $settings['min_amount'];?>'; |
|
| 56 | +var min_amount = '<?php echo $settings['min_amount']; ?>'; |
|
| 57 | 57 | min_amount = (min_amount != '') ? parseFloat(min_amount) : '0.00'; |
| 58 | 58 | |
| 59 | -var max_amount = '<?php echo $settings['max_amount'];?>'; |
|
| 59 | +var max_amount = '<?php echo $settings['max_amount']; ?>'; |
|
| 60 | 60 | max_amount = (max_amount != '') ? parseFloat(max_amount) : '10000000.00'; |
| 61 | 61 | |
| 62 | 62 | var quantity_selector = '<?php echo html_entity_decode($settings['quantity_selector']); ?>'; |
| 63 | 63 | |
| 64 | -var selector = '<?php echo html_entity_decode($settings['price_selector']);?>'; |
|
| 64 | +var selector = '<?php echo html_entity_decode($settings['price_selector']); ?>'; |
|
| 65 | 65 | |
| 66 | -var public_key = '<?php echo html_entity_decode($settings['public_key']);?>'; |
|
| 66 | +var public_key = '<?php echo html_entity_decode($settings['public_key']); ?>'; |
|
| 67 | 67 | |
| 68 | 68 | if (selector != '') { |
| 69 | 69 | var simulatorObject = {min_amount:min_amount, |