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 .='