Iniciar Checkout
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SDK Integration</title>
<script src="<https://sdk-web.y.uno/v1/static/js/main.min.js>"></script>
</head>
<body>
<script>
async function buildCheckout() {
const yuno = Yuno.initialize(public_key);
yuno.startCheckout({
checkoutSession: checkoutSessionId,
elementSelector: "#root",
countryCode: "BR",
language: "pt",
showLoading: true,
keepLoader: true,
issuersFormEnable: true,
renderMode: {
type: "element",
elementSelector: "#rootElement",
},
card: {
type: "extends",
cardSaveEnable: true,
},
onLoading: (args) => {
console.log(args);
},
async yunoCreatePayment(oneTimeToken) {
console.log("oneTimeToken: " + oneTimeToken)
**await createPayment();**
yuno.continuePayment({ showPaymentStatus: true });
},
yunoPaymentMethodSelected(data) {
console.log("onPaymentMethodSelected", data);
},
yunoPaymentResult(data) {
console.log("yunoPaymentResult", data);
yuno.hideLoader();
},
yunoError: (error) => {
console.log("There was an error", error);
yuno.hideLoader();
},
});
yuno.mountCheckoutLite({
paymentMethodType: "{{type}}",
});
}
</script>
</body>
</html>
Criar Pedido
Last updated
Was this helpful?

