<html>
<head>
<script src="https://ap-gateway.mastercard.com/checkout/version/60/checkout.js"
data-error="errorCallback"
data-cancel="cancelCallback"
data-complete="https://[your domain]/receiptPage">
</script>
<script type="text/javascript">
function errorCallback(error) {
console.log(JSON.stringify(error));
}
function cancelCallback() {
console.log('Payment cancelled');
}
Checkout.configure({
merchant:'<your_merchant_id>',
order: {
amount: 50,
currency: 'USD',
description: 'Ordered goods',
id: '<unique_order_id>'
},
session: {
id: '<checkout_session_id>'
},
interaction: {
operation: 'PURCHASE',
merchant: {
name: 'Your merchant name',
address: {
line1: '200 Sample St',
line2: '1234 Example Town'
}
}
}
});
</script>
</head>
<body>
//Choose LightBox or Payment Page
<input type="button" value="Pay with Lightbox" onclick="Checkout.showLightbox();" />
<input type="button" value="Pay with Payment Page" onclick="Checkout.showPaymentPage();" />
...
</body>
</html>