DIBS Payment Window (method 1)
- DIBS Payment Window as a pop-up window
The DIBS Payment Window is designed to be run either as a popup window or inline. Using the payment window as a popup can be accomplished by including the following JavaScript on the page that starts the payment process:
<script type="text/javascript">
<!--
var newwin = null;
function doPopup() {
newwin = window.open('', 'paywin', 'scrollbars,status,width=550,height=600');
newwin.focus();
return true;
} //-->
</script>
<!--
var newwin = null;
function doPopup() {
newwin = window.open('', 'paywin', 'scrollbars,status,width=550,height=600');
newwin.focus();
return true;
} //-->
</script>
The JavaScript is called when submitting the payment form, e.g.:
<a href="shopsite/payform.html" onclick="return doPopup();"
target="paywin">Start payment</a>
target="paywin">Start payment</a>
Example
Below is a code sample of a payment form loaded in the popup window, which automatically starts the DIBS Payment Window.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html>
<head>
<title>Example of a payment form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<script type="text/javascript"><!--
window.onload = function (evt) { document.forms[0].submit(); }
//-->
</script>
</head>
<body>
<form name="payform" method="post"
action="https://payment.architrade.com/payment/start.pml">
<input type="hidden" name="merchant" value="1111111" />
<input type="hidden" name="orderid" value="1234" />
<input type="hidden" name="lang" value="da" />
<input type="hidden" name="amount" value="4200" />
<input type="hidden" name="currency" value="208" />
<input type="hidden" name="accepturl" value="SHOPSERVER/accpted.html" />
<input type="hidden" name="callbackurl" value="SHOPSERVER/feedback.php" />
<input type="hidden" name="cancelurl" value="SHOPSERVER/canceled.html" />
<input type="hidden" name="delivery1.Navn" value="Jens Hansen" />
<input type="hidden" name="delivery2.Adresse" value="Apple Road 1" />
<input type="hidden" name="delivery3.Kommentar" value="Comment" />
<input type="hidden" name="ordline0-1" value="Item number" />
<input type="hidden" name="ordline0-2" value="description" />
<input type="hidden" name="ordline0-3" value="numer" />
<input type="hidden" name="ordline0-4" value="price" />
<input type="hidden" name="ordline1-1" value="102" />
<input type="hidden" name="ordline1-2" value="Pioneer CD player" />
<input type="hidden" name="ordline1-3" value="3" />
<input type="hidden" name="ordline1-4" value="1095" />
<input type="hidden" name="ordline2-1" value="201" />
<input type="hidden" name="ordline2-2" value="Sony DVD" />
<input type="hidden" name="ordline2-3" value="2" />
<input type="hidden" name="ordline2-4" value="1995" />
<input type="hidden" name="priceinfo1.shippingcosts" value="36" />
<input type="hidden" name="priceinfo2.VAT" value="1024" />
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<html>
<head>
<title>Example of a payment form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<script type="text/javascript"><!--
window.onload = function (evt) { document.forms[0].submit(); }
//-->
</script>
</head>
<body>
<form name="payform" method="post"
action="https://payment.architrade.com/payment/start.pml">
<input type="hidden" name="merchant" value="1111111" />
<input type="hidden" name="orderid" value="1234" />
<input type="hidden" name="lang" value="da" />
<input type="hidden" name="amount" value="4200" />
<input type="hidden" name="currency" value="208" />
<input type="hidden" name="accepturl" value="SHOPSERVER/accpted.html" />
<input type="hidden" name="callbackurl" value="SHOPSERVER/feedback.php" />
<input type="hidden" name="cancelurl" value="SHOPSERVER/canceled.html" />
<input type="hidden" name="delivery1.Navn" value="Jens Hansen" />
<input type="hidden" name="delivery2.Adresse" value="Apple Road 1" />
<input type="hidden" name="delivery3.Kommentar" value="Comment" />
<input type="hidden" name="ordline0-1" value="Item number" />
<input type="hidden" name="ordline0-2" value="description" />
<input type="hidden" name="ordline0-3" value="numer" />
<input type="hidden" name="ordline0-4" value="price" />
<input type="hidden" name="ordline1-1" value="102" />
<input type="hidden" name="ordline1-2" value="Pioneer CD player" />
<input type="hidden" name="ordline1-3" value="3" />
<input type="hidden" name="ordline1-4" value="1095" />
<input type="hidden" name="ordline2-1" value="201" />
<input type="hidden" name="ordline2-2" value="Sony DVD" />
<input type="hidden" name="ordline2-3" value="2" />
<input type="hidden" name="ordline2-4" value="1995" />
<input type="hidden" name="priceinfo1.shippingcosts" value="36" />
<input type="hidden" name="priceinfo2.VAT" value="1024" />
</form>
</body>
</html>
test