I have the implementation made for desktop and it works correctly in modal mode
function openCheckout() {
$MPC.openCheckout({
url: "{{mp_preference.response.sandbox_init_point}}",
mode: "modal",
onreturn: checkoutReturn
});
}
The problem is that in mobile, although it works, instead of opening a modal, it redirects me to the paid market site ... on desktop you close the modal and it executes: onReturn
function checkoutReturn(json) {
var mp_pago_id = json.collection_id;
if (json.collection_status == 'approved') {
notificar('Pago acreditado');
guardaPaymentId(mp_pago_id);
} else if (json.collection_status == 'pending') {
notificar('El usuario no completó el pago');
guardaPaymentId(mp_pago_id);
} else if (json.collection_status == 'in_process') {
notificar('El pago está siendo revisado');
guardaPaymentId(mp_pago_id);
} else if (json.collection_status == 'rejected') {
notificar('El pago fué rechazado, el usuario puede intentar nuevamente el pago');
} else if (json.collection_status == null) {
notificar('El usuario no completó el proceso de pago, no se ha generado ningún pago');
}
}
In mobile it does not run because it goes away from the screen where it was, I do not know if it's a bug or something else I have to add in mobile to work.
Greetings!