Skip to content

Commit

Permalink
v3.7.5 released
Browse files Browse the repository at this point in the history
  • Loading branch information
trgino committed Aug 25, 2023
1 parent 67b7a6a commit a276976
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion assets/moka-installment.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion assets/moka.js
Original file line number Diff line number Diff line change
@@ -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 = '';

/**
Expand Down
25 changes: 13 additions & 12 deletions core/library/Optimisthub_Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.='<input type="hidden" name="mokapay-order-total" value="'.$orderTotal.'">';
Expand All @@ -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 .='<fieldset style="padding-bottom:30px"><p class="form-row form-row-wide">';
Expand Down Expand Up @@ -267,14 +268,14 @@ private function renderedHtml( $response, $params )

$formHtml .=' <p class="form-row w-w-50">
<input '.$checked.' id="installment-pick'.$kk.'" type="radio" class="input-radio w-w-50" name="mokapay-installment" value="'.$perInstallmentKey.'">
<label for="installment-pick'.$kk.'"> '.$optionValue .' x '. self::calculateComissionRate($total, $installmentRates[$perInstallmentKey]['value'],$perInstallmentKey) . ' ' .$this->currency.'</label>
<label for="installment-pick'.$kk.'"> '.$optionValue .' x '. self::calculateComissionRate($orderTotal, $installmentRates[$perInstallmentKey]['value'],$perInstallmentKey) . ' ' .$this->currency.'</label>
</p>';

$formHtml .=' ';
#$formHtml .='<input type="radio" id="ins'.$kk.'" name="mokapay-installment" value="'.$perInstallmentKey.'">';
#$formHtml .='<div><label for="ins'.$kk.'">'.self::calculateComissionRate($total, $installmentRates[$perInstallmentKey]['value'],$perInstallmentKey) . ' ' .$this->currency.' x '.$optionValue.'</label></div><br>';
#$formHtml .='<div><label for="ins'.$kk.'">'.self::calculateComissionRate($orderTotal, $installmentRates[$perInstallmentKey]['value'],$perInstallmentKey) . ' ' .$this->currency.' x '.$optionValue.'</label></div><br>';

#$formHtml.='<option value="'.$perInstallmentKey.'">'.self::calculateComissionRate($total, $installmentRates[$perInstallmentKey]['value'],$perInstallmentKey) . ' ' .$this->currency.' x '.$optionValue.'</option>';
#$formHtml.='<option value="'.$perInstallmentKey.'">'.self::calculateComissionRate($orderTotal, $installmentRates[$perInstallmentKey]['value'],$perInstallmentKey) . ' ' .$this->currency.' x '.$optionValue.'</option>';
}
}
#$formHtml .= '</select>';
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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';

Expand Down

0 comments on commit a276976

Please sign in to comment.