shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

pp_braintree_order_ajax.twig (5872B)


      1 <table class="table table-bordered">
      2   <tr>
      3 		<td>{{ column_status }}</td>
      4 		<td>{{ transaction.status }}</td>
      5   </tr>
      6   <tr>
      7 		<td>{{ column_transaction_id }}</td>
      8 		<td>{{ transaction.transaction_id }}</td>
      9   </tr>
     10   <tr>
     11 		<td>{{ column_transaction_type }}</td>
     12 		<td>{{ transaction.type }}</td>
     13   </tr>
     14   <tr>
     15 		<td>{{ column_transaction_date }}</td>
     16 		<td>{{ transaction.date_added }}</td>
     17   </tr>
     18   <tr>
     19 		<td>{{ column_merchant_account }}</td>
     20 		<td>{{ transaction.merchant_account_id }}</td>
     21   </tr>
     22   <tr>
     23 		<td>{{ column_payment_type }}</td>
     24 		<td>{{ transaction.payment_type }}</td>
     25   </tr>
     26   <tr>
     27 		<td>{{ column_amount }}</td>
     28 		<td>{{ transaction.amount }} {{ transaction.currency }}</td>
     29   </tr>
     30   <tr>
     31 		<td>{{ column_order_id }}</td>
     32 		<td>{{ transaction.order_id }}</td>
     33   </tr>
     34 {% if transaction.processor_code %}
     35   <tr>
     36 		<td>{{ column_processor_code }}</td>
     37 		<td>{{ transaction.processor_code }}</td>
     38   </tr>
     39 {% endif %}
     40   <tr>
     41 		<td>{{ column_cvv_response }}</td>
     42 		<td>{{ transaction.cvv_response }}</td>
     43   </tr>
     44   <tr>
     45 		<td>{{ column_avs_response }}</td>
     46 		<td>{{ transaction.avs_response }}</td>
     47   </tr>
     48 {% if transaction.threeds_status %}
     49   <tr>
     50 		<td>{{ column_3ds_enrolled }}</td>
     51 		<td>{{ transaction.threeds_enrolled }}</td>
     52   </tr>
     53   <tr>
     54 		<td>{{ column_3ds_status }}</td>
     55 		<td>{{ transaction.threeds_status }}</td>
     56   </tr>
     57   <tr>
     58 		<td>{{ column_3ds_shifted }}</td>
     59 		<td>{{ transaction.threeds_shifted }}</td>
     60   </tr>
     61   <tr>
     62 		<td>{{ column_3ds_shift_possible }}</td>
     63 		<td>{{ transaction.threeds_shift_possible }}</td>
     64   </tr>
     65 {% endif %}
     66   <tr>
     67 	<td>{{ column_transaction_history }}</td>
     68 	<td>
     69 		<table class="table table-bordered">
     70 		  <thead>
     71 				<tr>
     72 					<td class="text-left">{{ column_date }}</td>
     73 					<td class="text-left">{{ column_status }}</td>
     74 				</tr>
     75 		  </thead>
     76 		  <tbody>
     77 				{% for status in statuses %}
     78 					<tr>
     79 						<td>{{ status.date_added }}</td>
     80 						<td>{{ status.status }}</td>
     81 					</tr>
     82 				{% endfor %}
     83 		  </tbody>
     84 		</table>
     85 	</td>
     86   </tr>
     87   <tr>
     88 	<td>{{ column_refund_history }}</td>
     89 	<td>
     90 		<table class="table table-bordered">
     91 		  <thead>
     92 				<tr>
     93 					<td class="text-left">{{ column_date }}</td>
     94 					<td class="text-left">{{ column_amount }}</td>
     95 					<td class="text-left">{{ column_status }}</td>
     96 				</tr>
     97 		  </thead>
     98 		  <tbody>
     99 				{% if refunds is not empty %}
    100 					{% for refund in refunds %}
    101 					<tr>
    102 						<td>{{ refund.date_added }}</td>
    103 						<td>{{ refund.amount }}</td>
    104 						<td>{{ refund.status }}</td>
    105 					</tr>
    106 					{% endfor %}
    107 				{% else %}
    108 			<tr>
    109 			  <td class="text-center" colspan="3">{{ text_no_refund }}</td>
    110 			</tr>
    111 			{% endif %}
    112 		  </tbody>
    113 		</table>
    114 	</td>
    115   </tr>
    116   <tr>
    117 	<td>{{ column_action }}</td>
    118 	<td>
    119 		<table class="table table-bordered">
    120 		  <thead>
    121 				<tr>
    122 					<td class="text-left">{{ column_void }}</td>
    123 					<td class="text-left">{{ column_settle }}</td>
    124 					<td class="text-left">{{ column_refund }}</td>
    125 				</tr>
    126 		  </thead>
    127 		  <tbody>
    128 				<tr>
    129 					<td>
    130 						{% if void_action is not empty %}
    131 							<a class="btn btn-primary button-command" data-type="void">{{ button_void }}</a>
    132 						{% else %}
    133 							{{ text_na }}
    134 						{% endif %}
    135 					</td>
    136 					<td>
    137 						{% if settle_action is not empty %}
    138 							<input id="settle-amount" text="text" name="settle_amount" value="{{ max_settle_amount }}" />
    139 							<a class="btn btn-primary button-command" data-type="settle">{{ button_settle }}</a>
    140 						{% else %}
    141 							{{ text_na }}
    142 						{% endif %}
    143 					</td>
    144 					<td>
    145 						{% if refund_action is not empty %}
    146 							<input id="refund-amount" text="text" name="refund_amount" value="{{ max_refund_amount }}" />
    147 							<a class="btn btn-primary button-command" data-type="refund">{{ button_refund }}</a>
    148 						{% else %}
    149 							{{ text_na }}
    150 						{% endif %}
    151 					</td>
    152 				</tr>
    153 		  </tbody>
    154 		</table>
    155 	</td>
    156   </tr>
    157 </table>
    158 
    159 <script type="text/javascript"><!--
    160 $('.button-command').on('click', function() {
    161 	var type = $(this).attr('data-type');
    162 	var confirm_text = '';
    163 	var clicked_button = $(this);
    164 
    165 	if (type === 'void') {
    166 		confirm_text = '{{ text_confirm_void }}';
    167 	} else if (type === 'settle') {
    168 		{% if symbol_left is not empty %}
    169 			confirm_text = '{{ text_confirm_settle }} ' + '{{ symbol_left }}' + $('#settle-amount').val();
    170 		{% elseif symbol_right is not empty %}
    171 			confirm_text = '{{ text_confirm_settle }} ' + $('#settle-amount').val() + '{{ symbol_right }}';
    172 		{% endif %}
    173 	} else if (type === 'refund') {
    174 		{% if symbol_left is not empty %}
    175 			confirm_text = '{{ text_confirm_refund }} ' + '{{ symbol_left }}' + $('#refund-amount').val();
    176 		{% elseif symbol_right is not empty %}
    177 			confirm_text = '{{ text_confirm_refund }} ' + $('#refund-amount').val() + '{{ symbol_right }}';
    178 		{% endif %}
    179 	}
    180 
    181 	if (confirm(confirm_text)) {
    182 		$.ajax({
    183 			url: 'index.php?route=extension/payment/pp_braintree/transactionCommand&user_token={{ user_token }}',
    184 			type: 'post',
    185 			data: {
    186 				type: type,
    187 				transaction_id: '{{ transaction_id }}',
    188 				amount: $(this).prev('input').val()
    189 			},
    190 			dataType: 'json',
    191 			beforeSend: function() {
    192 				clicked_button.button('loading');
    193 
    194 				$('.alert').hide().removeClass('alert-success alert-danger');
    195 			},
    196 			complete: function() {
    197 				clicked_button.button('reset');
    198 			},
    199 			success: function(json) {
    200 				if (json.error) {
    201 					$('.alert').show().addClass('alert-danger').html('<i class="fa fa-check-circle"></i> ' + json.error);
    202 				}
    203 
    204 				if (json.success) {
    205 					$('.alert').show().addClass('alert-success').html('<i class="fa fa-exclamation-circle"></i> ' + json.success);
    206 				}
    207 
    208 				getTransaction('{{ transaction_id }}');
    209 			}
    210 		});
    211 	}
    212 });
    213 //--></script>