Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/PISYL-260/update-qr-code-text' i…
Browse files Browse the repository at this point in the history
…nto add-Satispay
  • Loading branch information
SergejSavic committed Oct 28, 2024
2 parents 231468e + 8ff8563 commit f3f3ad4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Resources/assets/shop/js/mollie/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ $(function () {
}

if (qrCode) {
createPopup(qrCode);
let qrCodeMethod = 'Bancontact';
if (qrCode.indexOf('ideal') !== -1) {
qrCodeMethod = 'iDeal';
}
createPopup(qrCode, qrCodeMethod);
qrCodeInterval = setInterval(() => checkQrCode(url + '?orderId=' + orderId), 1000);
}
});
Expand Down Expand Up @@ -209,7 +213,7 @@ $(function () {

showQrCodePopUp();

function createPopup(qrCode) {
function createPopup(qrCode, qrCodeMethod) {
// Create popup container
var popupContainer = document.createElement('div');
popupContainer.id = 'popup-container';
Expand All @@ -232,7 +236,7 @@ $(function () {
var popupContent = document.createElement('div');
popupContent.classList.add('popup-content');
var paragraph = document.createElement('p');
paragraph.textContent = 'Open your Bancontact app to scan the QR code.';
paragraph.textContent = 'Open your ' + qrCodeMethod + ' app to scan the QR code.';
var qrCodeImg = document.createElement('img');
qrCodeImg.src = qrCode;
qrCodeImg.width = 180;
Expand Down Expand Up @@ -265,12 +269,12 @@ $(function () {
// Add event listeners to buttons
cancelButton.addEventListener('click', function (event) {
closePopup();
clearInterval(qrCodeInterval);
window.location.href = 'select-payment';
});

continueButton.addEventListener('click', function (event) {
closePopup();
window.location.href = 'select-payment';
clearInterval(qrCodeInterval);
});

// Append popup container to body
Expand Down

0 comments on commit f3f3ad4

Please sign in to comment.