-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41a4029
commit a289dff
Showing
17 changed files
with
651 additions
and
550 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,36 +177,40 @@ | |
</style> | ||
|
||
|
||
|
||
<div class="mollie-content js-mollie-content"> | ||
<div class="mollie-info-container js-info-loading m-info-show"> | ||
<div class="mollie-headline-container"> | ||
<div class="mollie-headline"> | ||
<span>Terminal name</span> | ||
<div class="mollie-headline"> | ||
<h2 class="m-headline loading">Follow the instructions on the terminal</h2> | ||
<h2 class="m-headline success" style="display:none">Your payment was successful!</h2> | ||
<h2 class="m-headline failed" style="display:none">Your payment was not successful!</h2> | ||
<p class="failed" style="display:none">No money has been debited from the debit card</p> | ||
<a href="#" title="Return to website" id="returnButton" class="m-button" style="display:none"> | ||
Return to website | ||
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><path d="M17.17 32.92l9.17-9.17-9.17-9.17 2.83-2.83 12 12-12 12z"/><path d="M0-.25h48v48h-48z" fill="none"/></svg> | ||
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M17.17 32.92l9.17-9.17-9.17-9.17 2.83-2.83 12 12-12 12z"/> | ||
<path d="M0-.25h48v48h-48z" fill="none"/> | ||
</svg> | ||
</a> | ||
</div> | ||
{% if changeStatusUrl %} | ||
<a href="{{ changeStatusUrl }}" title="Change Status in Test Mode" target="_blank" id="statusChange" class="m-button"> | ||
Change Status in Test Mode | ||
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><path d="M17.17 32.92l9.17-9.17-9.17-9.17 2.83-2.83 12 12-12 12z"/><path d="M0-.25h48v48h-48z" fill="none"/></svg> | ||
<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M17.17 32.92l9.17-9.17-9.17-9.17 2.83-2.83 12 12-12 12z"/> | ||
<path d="M0-.25h48v48h-48z" fill="none"/> | ||
</svg> | ||
</a> | ||
{% endif %} | ||
</div> | ||
<div class="mollie-image-container loading"> | ||
<img srcset="{{ asset('bundles/molliepayments/static/img/pos/[email protected]', 'asset') }} 2x {{ asset('bundles/molliepayments/static/img/pos/[email protected]', 'asset') }} 3x" src="{{ asset('bundles/molliepayments/static/img/pos/loading.png', 'asset') }}" alt="Mollie" /> | ||
<img srcset="{{ asset('bundles/molliepayments/static/[email protected]', 'asset') }} 2x {{ asset('bundles/molliepayments/static/[email protected]', 'asset') }} 3x" src="{{ asset('bundles/molliepayments/static/loading.png', 'asset') }}" alt="Mollie"/> | ||
</div> | ||
<div class="mollie-image-container success" style="display:none"> | ||
<img srcset="{{ asset('bundles/molliepayments/static/img/pos/[email protected]', 'asset') }} 2x {{ asset('bundles/molliepayments/static/img/pos/[email protected]', 'asset') }} 3x" src="{{ asset('bundles/molliepayments/static/img/pos/success.png', 'asset') }}" alt="Mollie" /> | ||
<img srcset="{{ asset('bundles/molliepayments/static/[email protected]', 'asset') }} 2x {{ asset('bundles/molliepayments/static/[email protected]', 'asset') }} 3x" src="{{ asset('bundles/molliepayments/static/success.png', 'asset') }}" alt="Mollie"/> | ||
</div> | ||
<div class="mollie-image-container failed" style="display:none"> | ||
<img srcset="{{ asset('bundles/molliepayments/static/img/pos/[email protected]', 'asset') }} 2x {{ asset('bundles/molliepayments/static/img/pos/[email protected]', 'asset') }} 3x" src="{{ asset('bundles/molliepayments/static/img/pos/failed.png', 'asset') }}" alt="Mollie" /> | ||
<img srcset="{{ asset('bundles/molliepayments/static/[email protected]', 'asset') }} 2x {{ asset('bundles/molliepayments/static/[email protected]', 'asset') }} 3x" src="{{ asset('bundles/molliepayments/static/failed.png', 'asset') }}" alt="Mollie"/> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -219,39 +223,44 @@ | |
const successElements = Array.from(document.getElementsByClassName('success')); | ||
const failedElements = Array.from(document.getElementsByClassName('failed')); | ||
function handleResponse(response){ | ||
console.log(response.target.response); | ||
function handleResponse(response) { | ||
const json = JSON.parse(response.target.response); | ||
if (json.ready) { | ||
clearInterval(interval); | ||
if(statusChangeButton !== null){ | ||
if (statusChangeButton !== null) { | ||
statusChangeButton.style.display = 'none'; | ||
} | ||
loadingElements.forEach(function(element){ | ||
loadingElements.forEach(function (element) { | ||
element.style.display = 'none'; | ||
}); | ||
returnButton.style.display = 'block'; | ||
returnButton.href= json.redirectUrl; | ||
if(json.status === 'open' || json.status === 'paid'){ | ||
successElements.forEach(function(element){ | ||
returnButton.href = json.redirectUrl; | ||
if (json.success) { | ||
successElements.forEach(function (element) { | ||
element.style.display = 'block'; | ||
}); | ||
}else{ | ||
failedElements.forEach(function(element){ | ||
} else { | ||
failedElements.forEach(function (element) { | ||
element.style.display = 'block'; | ||
}); | ||
} | ||
window.location.href = json.redirectUrl; | ||
} | ||
} | ||
function requestStatus() { | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', '/mollie/pos/{{ swOrderId }}/{{ molliePaymentId }}/status'); | ||
xhr.setRequestHeader('Content-Type', 'application/json'); | ||
xhr.onload = handleResponse; | ||
xhr.onerror = handleResponse; | ||
xhr.send(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters