Yes. To do this, handle the
ORDER_COMPLETED event in the
event handler code. You will get code similar to the following:
window.bukzaCallbackForBuzaContainer99999 = function(payload){
switch(payload.message.event){
//other handlers
case 'ORDER_COMPLETED':
window.location = 'https://example.com'
break;
}
};
In the example above:
- BuzaContainer99999 — the id value of the div container where the widget is embedded.
- https://example.com — the URL of the web page to which the customer should be redirected.
If you are inserting code inside a widget, use the following approach:
<html>
<body>
<script>
window.addEventListener('message', function (e) {
if (e && e.origin
&& e.origin.indexOf('bukza.com') !== -1)
var message = JSON.parse(e.data);
switch (message.event) {
//other handlers
case 'ORDER_COMPLETED':
window.top.location.href = 'https://example.com'
break;
}
}, false);
</script>
</body>
</html>