
{% if text_information %}
<div class="information">{{text_information}}</div>
{% endif %}

<form action="{{action}}" method="post" id="payment">
	<input name="merchantId"    type="hidden"  value="{{merchantId}}"   >
	<input name="accountId"     type="hidden"  value="{{accountId}}" >
	<input name="description"   type="hidden"  value="{{description}}"  >
	<input name="referenceCode" type="hidden"  value="{{referenceCode}}" >
	<input name="amount"        type="hidden"  value="{{amount}}"   >
	<input name="tax"           type="hidden"  value="{{tax}}"  >
	<input name="taxReturnBase" type="hidden"  value="{{taxReturnBase}}" >
	<input name="currency"      type="hidden"  value="{{currency}}" >
	<input name="signature"     type="hidden"  value="{{signature}}"  >
	<input name="buyerFullName" type="hidden"  value="{{buyerFullName}}" >
	<input name="buyerEmail"    type="hidden"  value="{{buyerEmail}}" >
	<input name="shippingAddress" type="hidden"  value="{{shippingAddress}}" >
	<input name="shippingCity"  type="hidden"  value="{{shippingCity}}" >
	<input name="zipCode"       type="hidden"  value="{{zipCode}}" >
	<input name="telephone"     type="hidden"  value="{{telephone}}" >
	<input name="responseUrl"   type="hidden"  value="{{responseUrl}}" >
	<input name="confirmationUrl" type="hidden"  value="{{confirmationUrl}}" >
	{% if payu_modoteste == 1 %}
	<input name="test"          type="hidden"  value="1" >
	{% endif %}
</form>
<div class="flex middle-xs end-xs top-margin-large">
  <button type="button" id="button-confirm" class="btn-default btn-large">
    <span>{{ button_confirm }}</span>
  </button>
</div>

<script type="text/javascript">
window.waitEvent('scripts_document', function(){
$('#button-confirm').bind('click', function() {
	$.ajax({
		type: 'GET',
		url: 'index.php?route=payment/payu/confirm',
		beforeSend: function() {
			$('#button-confirm').attr('disabled', true);

			$('#payment').before('<div class="attention"><img src="assets/img/loading-black.svg" alt="" /> {{text_wait}}</div>');
		},
		success: function() {
			$('#payment').submit();
		}
	});
});
});
</script>
