Please wait ...


Loading...

Events

Events

Here available events are described.

completed

If windowstate = 4, this function is called when the payment window is closed.
Please note line number 13 in the example below.
<div id="payment-div"></div>
<script type="text/javascript">
function PaymentWindowReady()
{
    paymentwindow = new PaymentWindow({
        'merchantnumber': "ENTER YOUR MERCHANT NUMBER HERE",
        'amount': "10095",
        'currency': "DKK",
        'windowstate': "4",
        'iframeheight': "400",
        'iframewidth': "360"
    });
    paymentwindow.on('completed', function(params){ alert('The Payment Window was completed: ' + params); });
    paymentwindow.append('payment-div');
    paymentwindow.open();
 }
</script>
<script charset="UTF-8" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" type="text/javascript"></script>

declined

If windowstate = 4, this function is called when a payment is declined.
Please note line number 13 in the example below.
<div id="payment-div"></div>
<script type="text/javascript">
function PaymentWindowReady()
{
    paymentwindow = new PaymentWindow({
        'merchantnumber': "ENTER YOUR MERCHANT NUMBER HERE",
        'amount': "10095",
        'currency': "DKK",
        'windowstate': "4",
        'iframeheight': "400",
        'iframewidth': "360"
    });
    paymentwindow.on('declined', function(){ alert('The Payment Window was declined'); });
    paymentwindow.append('payment-div');
    paymentwindow.open();
 }
</script>
<script charset="UTF-8" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" type="text/javascript"></script>

close

If windowstate = 1, this function is called when the payment window is closed.
Please note line number 9 in the example below.
<script type="text/javascript" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" charset="UTF-8"></script>
 
<script type="text/javascript">
    paymentwindow = new PaymentWindow({
        'merchantnumber': "ENTER YOUR MERCHANT NUMBER HERE",
        'amount': "10095",
        'currency': "DKK"
    });
    paymentwindow.on('close', function(){ alert('The Payment Window was closed.') });
</script>
 
<input type="button" onclick="javascript: paymentwindow.open()" value="Go to payment" />

feecalculated

This event includes a parameter which is the fee calculated on the basis of the cardtype. Note that the fee is in minor units. Feecalculated occurs when the customer is entering the card details, and Bambora registers the card type.

precompleted

This function doesn't include any parameters, but is an event which tells that the user pressed the 'complete payment' button in the payment window. You can show the user that the transaction starts and inform the user that she doesn't have to do anything. If the payment is declined, you'll get a declined event (see above).