forked from agustinfrancesconi/mp-ecommerce-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
31 lines (25 loc) · 698 Bytes
/
Copy pathscripts.js
File metadata and controls
31 lines (25 loc) · 698 Bytes
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
document.addEventListener('DOMContentLoaded', function () {
iniciarApp();
});
function iniciarApp(){
addEventButton();
}
function addEventButton(){
boton = document.querySelector("#mp-button");
preferencia_id = document.querySelector("#preferencia")
console.log(preferencia_id)
console.log(boton)
console.log("Click");
const mp = new MercadoPago('APP_USR-d81f7be9-ee11-4ff0-bf4e-20c36981d7bf',{
locale: 'es-AR'
});
mp.checkout({
preference:{
id: preferencia_id
},
render:{
container: '.mp-button',
label: 'Pagar',
}
})
}