diff --git a/assets/moka-installment.js b/assets/moka-installment.js index ef58b33..8111812 100644 --- a/assets/moka-installment.js +++ b/assets/moka-installment.js @@ -1,7 +1,7 @@ jQuery('.min--installment--price').click(function (e) { jQuery('a[href="#tab-installment_tab"]').trigger('click'); - var position = jQuery('#tab-installment_tab').offset().top; + let position = jQuery('#tab-installment_tab').offset().top; jQuery("body, html").animate({ scrollTop: position diff --git a/assets/moka.js b/assets/moka.js index 8a9ba16..522c70d 100644 --- a/assets/moka.js +++ b/assets/moka.js @@ -1,5 +1,5 @@ jQuery(document).ready(function () { - console.info('Moka PAY Core Js File loaded, successfully. Version 3.7.4'); + console.info('Moka PAY Core Js File loaded, successfully. Version 3.7.5'); let binCache = ''; /** diff --git a/core/library/Optimisthub_Ajax.php b/core/library/Optimisthub_Ajax.php index 5ae471c..2467020 100644 --- a/core/library/Optimisthub_Ajax.php +++ b/core/library/Optimisthub_Ajax.php @@ -211,12 +211,18 @@ private function fetchInstallment() */ private function renderedHtml( $response, $params ) { - $installmentRates = [ - 1 => [ + + $orderTotal = data_get($params, 'total'); + $installmentRates = data_get($params, 'installments.rates'); + $maxInstallment = data_get($params, 'card.MaxInstallmentNumber'); + + if(!isset($installmentRates[1])){ + $installmentRates[1] = [ 'active' => 1, 'value' => 0, - ], - ]; + ]; + } + $formHtml = ''; $formHtml.=''; @@ -227,11 +233,6 @@ private function renderedHtml( $response, $params ) return $formHtml; } - $total = data_get($params, 'total'); - $maxInstallment = data_get($params, 'card.MaxInstallmentNumber'); - $installmentRates = data_get($params, 'installments.rates'); - $orderTotal = $total; - if($installmentRates) { $formHtml .='

'; @@ -267,14 +268,14 @@ private function renderedHtml( $response, $params ) $formHtml .='

- +

'; $formHtml .=' '; #$formHtml .=''; - #$formHtml .='

'; + #$formHtml .='

'; - #$formHtml.=''; + #$formHtml.=''; } } #$formHtml .= ''; diff --git a/index.php b/index.php index b90a769..56f0776 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: Moka Payment Gateway for WooCommerce * Plugin URI: https://github.com/optimisthub/moka-woocommerce * Description: Moka Payment gateway for woocommerce - * Version: 3.7.4 + * Version: 3.7.5 * Author: Optimist Hub * Author URI: https://optimisthub.com?ref=mokaPayment * Domain Path: /languages/ @@ -14,7 +14,7 @@ exit; } -define('OPTIMISTHUB_MOKA_PAY_VERSION', '3.7.4'); +define('OPTIMISTHUB_MOKA_PAY_VERSION', '3.7.5'); require __DIR__ . '/vendor/autoload.php';