diff --git a/app/Services/BillplzService.php b/app/Services/BillplzService.php index ebd64d0..1eb6a40 100644 --- a/app/Services/BillplzService.php +++ b/app/Services/BillplzService.php @@ -279,9 +279,29 @@ class BillplzService } protected function isBase64($string) { + if($this->isBase64UrlSafe($string)){ + return true; + } + if (preg_match('/^[A-Za-z0-9+\/=]+$/', $string)) { return base64_encode(base64_decode($string, true)) === $string; } return false; } + + protected function isBase64UrlSafe($string) { + // Convert URL-safe Base64 to standard Base64 + $standardBase64 = str_replace(['-', '_'], ['+', '/'], $string); + + // Add padding if necessary + $remainder = strlen($standardBase64) % 4; + if ($remainder > 0) { + $standardBase64 .= str_repeat('=', 4 - $remainder); + } + + // Attempt to decode the string + $decoded = base64_decode($standardBase64, true); + + return $decoded !== false; // Return true if it successfully decodes + } } diff --git a/public/js/miscellaneous/cart.js b/public/js/miscellaneous/cart.js index 3aef8e0..6123a7b 100644 --- a/public/js/miscellaneous/cart.js +++ b/public/js/miscellaneous/cart.js @@ -2,11 +2,15 @@ let checked_rad = () =>{ const radios = document.querySelectorAll('input[name="radpembayaran"]'); // let rad_payment = document.getElementById('radpembayaran'); let btn_payment = document.getElementById('bayarsbmt'); + let btn_payment_phone = document.getElementById('bayarsbmt-phone'); + if(radios.checked){ btn_payment.disabled = false; + btn_payment_phone.disabled = false; }else{ btn_payment.disabled = true; + btn_payment_phone.disabled = true; } } @@ -15,9 +19,11 @@ const radios = document.querySelectorAll('input[name="radpembayaran"]'); radios.forEach((radio) => { radio.addEventListener('change', function () { let btn_payment = document.getElementById('bayarsbmt'); + let btn_payment_phone = document.getElementById('bayarsbmt-phone'); let content1 = document.getElementById('divpkb'); let content2 = document.getElementById('divkopkb'); let whole_total = document.getElementById('spanjumlah'); + let whole_total_phone = document.getElementById('spanjumlah-phone'); let inputs = document.querySelectorAll(`#div${this.value} input[type="number"]`); let values = Array.from(inputs).map(input => parseFloat(input.value) || 0).reduce((sum,value) => sum + value, 0); @@ -31,10 +37,12 @@ radios.forEach((radio) => { inputenabled.forEach(input =>{ input.disabled = false; }); - content1.classList.add('blurred'); - content2.classList.remove('blurred'); + content1?.classList.add('blurred'); + content2?.classList.remove('blurred'); btn_payment.disabled = false; - whole_total.innerHTML = values + 1; + btn_payment_phone.disabled = false; + whole_total.innerHTML = formatter.format(values + 1); + whole_total_phone.innerHTML = formatter.format(values + 1); }else{ let inputsdisabled = document.querySelectorAll(`#divkopkb input:not([type="radio"])`); @@ -46,10 +54,12 @@ radios.forEach((radio) => { inputenabled.forEach(input =>{ input.disabled = false; }); - content2.classList.add('blurred'); - content1.classList.remove('blurred'); + content2?.classList.add('blurred'); + content1?.classList.remove('blurred'); btn_payment.disabled = false; - whole_total.innerHTML = values + 1; + btn_payment_phone.disabled = false; + whole_total.innerHTML = formatter.format(values + 1); + whole_total_phone.innerHTML = formatter.format(values + 1); } } diff --git a/resources/views/includes/bayaran/pembayaransag.blade.php b/resources/views/includes/bayaran/pembayaransag.blade.php index aabab50..cd9e50f 100644 --- a/resources/views/includes/bayaran/pembayaransag.blade.php +++ b/resources/views/includes/bayaran/pembayaransag.blade.php @@ -15,6 +15,26 @@ opacity: 0.5; /* Slight transparency */ /*pointer-events: none; */ } + + @media (max-width: 768px) { /* Target screens smaller than tablets */ + .sticky-footer { + position: fixed; + bottom: 0; + left: 0; + right: 0; + background-color: white; /* Adjust to match your theme */ + height:100px; + box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Optional shadow for better visibility */ + padding: 10px; /* Add some padding for spacing */ + z-index: 1000; /* Ensure it stays above other content */ + text-align: center; /* Center align buttons */ + } + + .sticky-footer .btn { + width: 45%; /* Ensure buttons fit well side-by-side */ + margin: 0 5px; /* Add spacing between buttons */ + } + } Bayar SAG | Portal Pelanggan @@ -32,8 +52,8 @@ -
-
+
+
@if($list_pkb)
@@ -203,7 +223,7 @@ @endif
-
+
@@ -255,6 +275,40 @@
+
+ + +
@@ -507,6 +561,7 @@ $("#spanbayaranarrahn").text(sumarrahn.toFixed(2)); $("#spanbayarantawarruq").text(sumtawarruq.toFixed(2)); $('#spanjumlah').text(formatter.format(sum + 1)); + $('#spanjumlah-phone').text(formatter.format(sum + 1)); } if (document.addEventListener) {