<div class="us-content-title">{{ text_instruction }}</div>
<div class="well well-sm">
  <p><b>{{ text_payable }}</b></p>
  <p>{{ payable }}</p>
  <b>{{ text_address }}</b><br />
  <p>{{ address }}</p>
  <p>{{ text_payment }}</p>
</div>
<div class="buttons">
    <input type="button" value="{{ button_confirm }}" id="button-confirm" data-loading-text="{{ text_loading }}" class="button button-primary br-7" />
</div>
<script>
$('#button-confirm').on('click', function() {
	$.ajax({
		url: 'index.php?route=extension/payment/cheque/confirm',
		dataType: 'json',
		cache: false,
		beforeSend: function() {
			$('#button-confirm').button('loading');
		},
		complete: function() {
			$('#button-confirm').button('reset');
		},
		success: function(json) {
			if (json['redirect']) {
				location = json['redirect'];	
			}
		},
		error: function(xhr, ajaxOptions, thrownError) {
			console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});

});
</script>
