diff --git a/class/class-parolapara.php b/class/class-parolapara.php index 7a12105..b4bfde1 100644 --- a/class/class-parolapara.php +++ b/class/class-parolapara.php @@ -47,43 +47,32 @@ public function getInstallment($par, $order) if ($installament->status_code == 100) { - $html = '
'; - $html .= ''; - $html .= ''; + $html = ['
']; + $html[] = '
'; + $html[] = '
'; + $html[] = ''; foreach ($installament->data as $key => $taksitler) { if ($taksitler->installments_number == 1) { $text_value = "Tek Çekim"; } else { - $text_value = $taksitler->installments_number . " x " . $taksitler->payable_amount; - } - $total = $taksitler->amount_to_be_paid; - if (empty(explode(".", $total)[1])) { - $total = $total . ".00"; - } else { - if (strlen(explode(".", $total)[1]) == 1) { - $total = $total . "0"; - } + $text_value = $taksitler->installments_number . " x " . $this->fixNumberFormat($taksitler->amount_to_be_paid); } - $html .= ''; + $total = $this->fixNumberFormat($taksitler->payable_amount); + + $html[] = ''; - $html .= ''; - $html .= ''; - $html .= ''; + $html[] = ''; + $html[] = ''; + $html[] = ''; } - $html .= '
'; - $html .= 'installments_number == 1) { - $html .= 'checked'; - } - $html .= 'value="' . $taksitler->installments_number . '"'; - $html .= 'tag="' . $total . '"'; - $html .= '
'; + $html[] = 'installments_number == 1 ? 'checked' : '') . ' value="' . $taksitler->installments_number . '" tag="' . $total . '">'; + $html[] = '
'; + $html[] = ''; - return $html; + return implode('', $html); } else { return "
Bu karta taksit yapılmamaktadır.
"; } @@ -105,10 +94,10 @@ public function start3d($order_id) $product = $item->get_product(); $items[] = [ - 'price' => str_replace(".00", "", $product->get_price()), + 'price' => floatval($this->fixNumberFormat($product->get_price())), 'name' => $item->get_name(), 'quantity' => $item->get_quantity(), - 'description' => $item->get_name() . " ürünü", + 'description' => $item->get_name(), ]; } @@ -412,7 +401,7 @@ public function validateHashKey($hashKey) $salt = isset($components[1]) ? $components[1] : ""; $salt = hash('sha256', $password . $salt); $encryptedMsg = isset($components[2]) ? $components[2] : ""; - $decryptedMsg = openssl_decrypt($encryptedMsg, 'aes-256-cbc', $salt, null, $iv); + $decryptedMsg = openssl_decrypt($encryptedMsg, 'aes-256-cbc', $salt, 0, $iv); if (strpos($decryptedMsg, '|') !== false) { $array = explode('|', $decryptedMsg); $status = isset($array[0]) ? $array[0] : 0; diff --git a/index.php b/index.php index 36c8442..09df5d2 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ Plugin Name: Parolapara Plugin URI: Description: Parolapara ile ödemeye almaya başlayın -Version: 1.0.2 +Version: 1.0.3 Author: Ravensoft Author URI: License: GNU diff --git a/view/payment-form-api.php b/view/payment-form-api.php index 4cd9a3e..e0b1d4b 100644 --- a/view/payment-form-api.php +++ b/view/payment-form-api.php @@ -497,23 +497,19 @@ function preventKeysForCVC(event) { } } - function updateSubmitButtonAmount(myAmount) { - if (myAmount != undefined) { - $("#paybuttontext").prop("disabled", false); - $("#registerbtn").prop("disabled", false); - $("#paybuttontext").text(myAmount + " ₺ Öde"); - $('[name="odenecek_tutar"]').val(myAmount); - } - updateTaksit(); - } - - function updateTaksit() { - var sectigimTaksit = $('input[name="tno"]:checked').attr("data-sayi"); - $('[name="secilen_taksit"]').val(sectigimTaksit); - }