-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
84 lines (78 loc) · 1.77 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
(() => {
const malgaCheckoutFull = document.querySelector("malga-checkout-full");
malgaCheckoutFull.paymentMethods = {
pix: {
expiresIn: 3600,
},
credit: {
installments: {
quantity: 1,
show: true,
},
checkedSaveCard: false,
showCreditCard: true,
},
boleto: {
expiresDate: "2022-12-31",
instructions: "Instruções para pagamento do boleto",
interest: {
days: 1,
amount: 100,
},
fine: {
days: 2,
amount: 200,
},
},
};
malgaCheckoutFull.transactionConfig = {
statementDescriptor: "#1 Demonstration Malga Checkout",
amount: 100,
description: "",
orderId: "",
currency: "BRL",
capture: false,
};
malgaCheckoutFull.dialogConfig = {
show: true,
actionButtonLabel: "Continuar",
errorActionButtonLabel: "Tentar novamente",
successActionButtonLabel: "Continuar",
successRedirectUrl: "https://www.malga.io/",
};
malgaCheckoutFull.pageConfig = {
footerDescription: "Todos os direitos reservados © 2023 Malga.",
backRoute: "https://www.malga.io/",
delivery: 0,
products: [
{
name: "Produto 1",
quantity: 2,
amount: 50,
description: "Descrição do produto 1",
sku: "123",
risk: "Low",
},
{
name: "Produto 2",
quantity: 2,
amount: 40,
description: "Descrição do produto 2",
sku: "124",
risk: "Low",
},
],
};
malgaCheckoutFull.addEventListener(
"transactionSuccess",
({ detail: { data } }) => {
console.log(data);
}
);
malgaCheckoutFull.addEventListener(
"transactionFailed",
({ detail: { error } }) => {
console.log(error);
}
);
})();