$('#checkout-confirm').on('submit', function(e) {
  e.preventDefault();
  var
  $this = $(this);
  
	$.ajax({
		type: 'get',
    url: 'index.php?route=payment/mercadopago2/confirm',
    datatype: 'json',
    beforeSend: function() {
			$this.find('.ftr-steps__button').prop('disabled', true);
      $('.ftr-loading-bar').removeClass('ftr-none');
		},
    complete: function() {
      $('.ftr-loading-bar').addClass('ftr-none');
      $this.find('.ftr-steps__button').prop('disabled', false);
    },
		success: function(json) {
      if(json['link']){
        window.location = json['link'];
      }			
		}
	});
});
