We use js callback function to receive the data back from the credit card dialog
We have placed this js script to the page:
<script src="/checkout/dist/checkout.min.js"></script>
<script>
window.cc_callback = function(data)
{
alert( 'The CC dialog returned: \r\n \r\n'+ JSON.stringify(data) );
}
window.Maksekeskus.Checkout.initialize({
'key' : '',
'transaction' : '',
'email' : 'john@diehard.ly',
'clientName' : 'John McLane',
'locale' : 'en',
'completed' : 'cc_callback',
'cancelled' : 'cc_callback'
});
</script>
<button type="button" class="btn btn-primary" aria-label="Open CC Payment dialog" onclick="window.Maksekeskus.Checkout.open();">Open payment dialog</button>