Pre-registration
If you have some anticipated sales material, it's beneficial to allow your end-users to pre-register with banq and add payment methods before the sales material is available for purchase. To implement banq's "pre-registration" widget, use the following html snippet. The pre-registration code is very similar to the checkout widget, only omitting the payment link (return null
) and adding an additional parameter .
<html>
<head>
<title>Banq Widget</title>
</head>
<body>
<script src="https://sandbox.banq.com/widget/ecommerce.js"></script>
<div id="pay-with-banq"></div>
<script>
const app = new window.ecommerceBanqWidget({
selector: '#pay-with-banq',
mode: "pre-register-flow",
getPaymentInfo: () => {
return null
},
// this function will trigger callback when user will close widget
onPopUpClose: () => {
console.log('pop up is closed action');
},
// this function will trigger callback after success payment
onPaymentSuccess: () => {
console.log('this triggers after payment completed successfully');
}
});
app.bootstrapApp();
</script>
</body>
</html>
Updated over 3 years ago