Square payments

This commit is contained in:
= 2021-08-14 20:09:13 +10:00
parent 82a0a311cd
commit 5c8976a50f

View File

@ -38,12 +38,15 @@
return card;
}
document.addEventListener('DOMContentLoaded', async function () {
document.addEventListener('DOMContentLoaded', async function () {
if (!window.Square) {
throw new Error('Square.js failed to load properly');
}
const payments = window.Square.payments(appId, locationId);
let card;
try {
card = await initializeCard(payments);
} catch (e) {
@ -52,7 +55,7 @@ document.addEventListener('DOMContentLoaded', async function () {
}
// Step 5.2: create card payment
});
});
</script>
@endsection