Checkout SDK
Checkout SDK enables users to checkout on a third-party platform with a bank transfer and BNPL(buy now and pay later) option.
Last updated
Checkout SDK enables users to checkout on a third-party platform with a bank transfer and BNPL(buy now and pay later) option.
Last updated
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Duplo Checkout</title>
<link
rel="stylesheet"
href="https://public-files-duplo-prod.s3.eu-west-1.amazonaws.com/dp-checkout-assets/dist/checkout-dp.css"
/>
</head>
<body>
<script src="https://public-files-duplo-prod.s3.eu-west-1.amazonaws.com/dp-checkout-assets/dist/duploCheckout.js"></script>
<script>
window.addEventListener("DOMContentLoaded", function () {
var options = {
stepToDisplay: "welcome",
redirectOption: true,
callback_url: "https://google.com",
cancel_url: "https://facebook.com",
checkout_info: {
business_id: "98d34111-69dc-4683-9bbe-2e6921gd155c",
customer_firstname: "Test",
customer_lastname: "User",
customer_email: "[email protected]",
customer_phone_number: "07211155866",
amount: "10000",
fee_bearer: "customer",
preferred_payment_methods: ["pay-with-transfer"],
line_items: [
{
name: "Stock fish",
unit_price: 50,
quantity: 1,
},
],
shipping_fee: 0,
discount: {
type: "percentage",
value: 10,
},
tax: {
type: "percentage",
value: 20,
description: "VAT",
},
for_checkout: true,
checkout_type: "pay-with-transfer",
},
};
new DuploCheckout(
options,
(onSuccess = function (response) {
console.log(response);
}),
(onError = function (response) {
console.log(response);
}),
(onClose = function (response) {
console.log("close");
})
);
});
</script>
</body>
</html><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Duplo Checkout</title>
<link
rel="stylesheet"
href="https://public-files-duplo-prod.s3.eu-west-1.amazonaws.com/dp-checkout-assets/dist/checkout-dp.css"
/>
</head>
<body>
<script src="https://public-files-duplo-prod.s3.eu-west-1.amazonaws.com/dp-checkout-assets/dist/duploCheckout.js"></script>
<script>
window.addEventListener("DOMContentLoaded", function () {
var options = {
stepToDisplay: "welcome",
redirectOption: true,
callback_url: "https://google.com",
cancel_url: "https://facebook.com",
checkout_info: {
business_id: "98d34111-69dc-4683-9bbe-2e6921gd155c",
customer_firstname: "Test",
customer_lastname: "User",
customer_email: "[email protected]",
customer_phone_number: "07211155866",
amount: "10000",
fee_bearer: "customer",
preferred_payment_methods: ["bnpl"],
line_items: [
{
name: "Stock fish",
unit_price: 50,
quantity: 1,
},
],
shipping_fee: 0,
discount: {
type: "percentage",
value: 10,
},
tax: {
type: "percentage",
value: 20,
description: "VAT",
},
for_checkout: true,
checkout_type: "bnpl",
},
};
new DuploCheckout(
options,
(onSuccess = function (response) {
console.log(response);
}),
(onError = function (response) {
console.log(response);
}),
(onClose = function (response) {
console.log("close");
})
);
});
</script>
</body>
</html>