-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathform.phtml
38 lines (31 loc) · 1.06 KB
/
form.phtml
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
<div class="mp"></div>
<script src="https://www.mercadopago.com/v2/security.js" view="checkout"></script>
<script src="https://sdk.mercadopago.com/js/v2"></script>
<div class="cho-container"></div>
<script>
const mp = new MercadoPago("<?php echo $this->publicKey; ?>", {
locale: 'es-MX'
});
const checkout = mp.checkout({
preference: {
id: '<?=$this->pregerenceId?>'
},
//autoOpen: true,
//render: {
// container: '.mp',
// label: 'Pagar MercadoPago',
// }
});
</script>
<input type="button" class="app-btns primary mercadopagobtn" value="Pagar con MercadoPago">
<script>
function mercadopagoOpenHandler(e){
checkout.open();
return true;
}
$('.mercadopagobtn').on('click', function(e) {
e.preventDefault();
$('.mercadopagobtn').hasClass('disabled')
mercadopagoOpenHandler();
});
</script>