Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
trgino committed Sep 26, 2024
1 parent f40ee54 commit 2d30cef
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 51 deletions.
47 changes: 18 additions & 29 deletions class/class-parolapara.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,32 @@ public function getInstallment($par, $order)

if ($installament->status_code == 100) {

$html = '<div class="col wid100" id="tlist">';
$html .= '<table class="table border rounded bg-white">';
$html .= '<tbody>';
$html = ['<div class="col wid100" id="tlist">'];
$html[] = '<div class="col wid100" id="tlist">';
$html[] = '<table class="table border rounded bg-white">';
$html[] = '<tbody>';

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 .= '<tr><td class="px-3 py-2"><div class="form-check">';
$html .= '<input type="radio" data-sayi="' . $taksitler->installments_number . '" id="tno' . $taksitler->installments_number . '" ';
$html .= 'onclick="updateSubmitButtonAmount(\'' . $total . '\')" class="form-check-input p-1" name="tno"';
if ($taksitler->installments_number == 1) {
$html .= 'checked';
}
$html .= 'value="' . $taksitler->installments_number . '"';
$html .= 'tag="' . $total . '"';
$html .= '<label class="form-check-label" for="tno' . $taksitler->installments_number . '"><strong>' . $text_value . '</strong></label></div></td>';
$total = $this->fixNumberFormat($taksitler->payable_amount);

$html[] = '<tr><td class="px-3 py-2"><div class="form-check taksit-radio">';
$html[] = '<input type="radio" data-sayi="' . $taksitler->installments_number . '" data-total="' . $total . '" data-currency="' . $order->get_currency() . '" data-no="' . $taksitler->installments_number . '" id="tno' . $taksitler->installments_number . '" class="form-check-input p-1" name="tno" ' . ($taksitler->installments_number == 1 ? 'checked' : '') . ' value="' . $taksitler->installments_number . '" tag="' . $total . '">';
$html[] = '<label class="form-check-label" for="tno' . $taksitler->installments_number . '"><strong>' . $text_value . '</strong></label></div></td>';

$html .= '<td class="px-3 py-2" id="instalmentTd' . $key . '"><label for="tno1">' . $total . ' ' . $order->get_currency() . ' </label></td>';
$html .= '<td class="px-3 py-2 text-primary"><strong></strong></td></tr>';
$html .= '<input type="hidden" name="tsx' . $taksitler->installments_number . '" value="' . $taksitler->hash_key . '">';
$html[] = '<td class="px-3 py-2" id="instalmentTd' . $key . '"><label for="tno1">' . $total . ' ' . $order->get_currency() . ' </label></td>';
$html[] = '<td class="px-3 py-2 text-primary"></td></tr>';
$html[] = '<input type="hidden" name="tsx' . $taksitler->installments_number . '" value="' . $taksitler->hash_key . '">';
}

$html .= '</tbody></table></div>';
$html[] = '</tbody></table></div>';

return $html;
return implode('', $html);
} else {
return "<h5>Bu karta taksit yapılmamaktadır.</h5>";
}
Expand All @@ -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(),
];
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 11 additions & 21 deletions view/payment-form-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
</script>
<script>
$(document).ready(function () {
$('#taksit').on('click', '.taksit-radio', function(){
$("#paybuttontext").prop("disabled", false);

$('input[type="radio"]', this).prop('checked', true);

$("#paybuttontext").text($('input[type="radio"]', this).data('total')+' '+$('input[type="radio"]', this).data('currency')+' Öde');
$('input[name="odenecek_tutar"]').val($('input[type="radio"]', this).data('total'));

$('input[name="secilen_taksit"]').val($('input[type="radio"]', this).data('no'));
});
if (document.getElementById('coverScreen') != undefined)
document.getElementById('coverScreen').hidden = true;
$('#cvv').keydown(function (event) {
Expand Down Expand Up @@ -606,9 +602,6 @@ function _onblur_number(amorjValue) {
$("#taksitp").html("Taksit Seçenekleri");
if ($("#instalmentTd0").html() != undefined) {
$("#paybuttontext").text($("#instalmentTd0")[0].children[0].innerHTML + " Öde");
if ($("#registerbtn") != undefined) {
$("#registerbtn").prop("disabled", false);
}
} else {
if ($("#foreignPaymenAllowShow").html() == undefined) {
if ('NONE' == PAYMENT_ROUTER_PAY_BY_LINK) {
Expand Down Expand Up @@ -692,12 +685,9 @@ function getCurrencyData(sel) {
$("#ForeignPaymenAllowData").show();
$("#paybuttontext").prop("disabled", false);
$("#paybuttontext").text($("#CURRENCY_CODE_ALPHA").val() + " " + $("#SALE_AMOUNT").val() + " Öde");
if ($("#cpaybuttontext") != undefined) {
if ($("#cpaybuttontext").length) {
$("#cpaybuttontext").prop("disabled", false);
}
if ($("#registerbtn") != undefined) {
$("#registerbtn").prop("disabled", false);
}
}
</script>
<script>
Expand Down

0 comments on commit 2d30cef

Please sign in to comment.