shop.balmet.com

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

firstdata_remote_order.twig (7069B)


      1 <h2>{{ text_payment_info }}</h2>
      2 <div class="alert alert-success" id="firstdata_transaction_msg" style="display: none;"></div>
      3 <table class="table table-striped table-bordered">
      4   <tr>
      5     <td>{{ text_order_ref }}</td>
      6     <td>{{ firstdata_order.order_ref }}</td>
      7   </tr>
      8   <tr>
      9     <td>{{ text_order_total }}</td>
     10     <td>{{ firstdata_order.total_formatted }}</td>
     11   </tr>
     12   <tr>
     13     <td>{{ text_total_captured }}</td>
     14     <td id="firstdata_total_captured">{{ firstdata_order.total_captured_formatted }}</td>
     15   </tr>
     16   <tr>
     17     <td>{{ text_capture_status }}</td>
     18     <td id="capture_status">{% if firstdata_order.capture_status == 1 %}
     19       <span class="capture_text">{{ text_yes }}</span>
     20       {% else %}
     21       <span class="capture_text">{{ text_no }}</span>&nbsp;&nbsp;
     22       {% if firstdata_order.void_status == 0 %}
     23       <a class="btn btn-primary" id="button-capture">{{ button_capture }}</a> <span class="btn btn-primary" id="img_loading_capture" style="display:none;"><i class="fa fa-circle-o-notch fa-spin fa-lg"></i></span>
     24       {% endif %}
     25       {% endif %}</td>
     26   </tr>
     27   <tr>
     28     <td>{{ text_void_status }}</td>
     29     <td id="void_status">{% if firstdata_order.void_status == 1 %}
     30       <span class="void_text">{{ text_yes }}</span>
     31       {% else %}
     32       <span class="void_text">{{ text_no }}</span>&nbsp;&nbsp;
     33       {% if firstdata_order.capture_status == 0 %}
     34       <a class="btn btn-primary" id="button-void">{{ button_void }}</a> <span class="btn btn-primary" id="img_loading_void" style="display:none;"><i class="fa fa-circle-o-notch fa-spin fa-lg"></i></span>
     35       {% endif %}
     36       {% endif %}></td>
     37   </tr>
     38   <tr>
     39     <td>{{ text_refund_status }}</td>
     40     <td id="refund_status">{% if firstdata_order.refund_status == 1 %}
     41       <span class="refund_text">{{ text_yes }}</span>
     42       {% else %}
     43       <span class="refund_text">{{ text_no }}</span>&nbsp;&nbsp;
     44       {% if firstdata_order.capture_status == 0 or firstdata_order.void_status == 1 %}
     45       <a class="btn btn-primary" id="button-refund" style="display:none;">{{ button_refund }}</a>
     46       {% else %}
     47       <a class="btn btn-primary" id="button-refund">{{ button_refund }}</a>
     48       {% endif %}
     49       <span class="btn btn-primary" id="img_loading_refund" style="display:none;">
     50         <i class="fa fa-circle-o-notch fa-spin fa-lg"></i>
     51       </span>
     52       {% endif %}</td>
     53   </tr>
     54   <tr>
     55     <td>{{ text_transactions }}:</td>
     56     <td><table class="table table-striped table-bordered" id="firstdata_transactions">
     57         <thead>
     58           <tr>
     59             <td class="text-left"><strong>{{ text_column_date_added }}</strong></td>
     60             <td class="text-left"><strong>{{ text_column_type }}</strong></td>
     61             <td class="text-left"><strong>{{ text_column_amount }}</strong></td>
     62           </tr>
     63         </thead>
     64         <tbody>
     65           {% for transaction in firstdata_order.transactions %}
     66           <tr>
     67             <td class="text-left">{{ transaction.date_added }}</td>
     68             <td class="text-left">{{ transaction.type }}</td>
     69             <td class="text-left">{{ transaction.amount }}</td>
     70           </tr>
     71           {% endfor %}
     72         </tbody>
     73       </table></td>
     74   </tr>
     75 </table>
     76 <script type="text/javascript"><!--
     77 $('#button-void').bind('click', function () {
     78 	if (confirm('{{ text_confirm_void }}')) {
     79 		$.ajax({
     80 			type:'post',
     81 			dataType: 'json',
     82 			data: 'order_id={{ order_id }}',
     83 			url: 'index.php?route=extension/payment/firstdata_remote/void&user_token={{ user_token }}',
     84 			beforeSend: function() {
     85 				$('#button-void').hide();
     86 				$('#img_loading_void').show();
     87 				$('#firstdata_transaction_msg').hide();
     88 			},
     89 			success: function(data) {
     90 				if (data['error'] == false) {
     91 					html = '';
     92 					html += '<tr>';
     93 					html += '<td class="text-left">'+data.data.date_added+'</td>';
     94 					html += '<td class="text-left">void</td>';
     95 					html += '<td class="text-left">0.00</td>';
     96 					html += '</tr>';
     97 
     98 					$('. void_text').text('{{ text_yes }}');
     99 
    100 					$('#firstdata_transactions').append(html);
    101 
    102 					$('#button-capture').hide();
    103 
    104 					if (data.msg != '') {
    105 						$('#firstdata_transaction_msg').empty().html('<i class="fa fa-check-circle"></i> ' + data['msg']).fadeIn();
    106 					}
    107 				}
    108 
    109 				if (data['error'] == true) {
    110 					alert(data['msg']);
    111 
    112 					$('#button-void').show();
    113 				}
    114 
    115 				$('#img_loading_void').hide();
    116 			}
    117 		});
    118 	}
    119 });
    120 
    121 $('#button-capture').bind('click', function () {
    122 	if (confirm('{{ text_confirm_capture }}')) {
    123 		$.ajax({
    124 		type:'POST',
    125 		dataType: 'json',
    126 		data: {'order_id': {{ order_id }} },
    127 		url: 'index.php?route=extension/payment/firstdata_remote/capture&user_token={{ user_token }}',
    128 		beforeSend: function() {
    129 		$('#button-capture').hide();
    130 		$('#img_loading_capture').show();
    131 		$('#firstdata_transaction_msg').hide();
    132 		},
    133 		success: function(data) {
    134 		if (data.error == false) {
    135 		html = '';
    136 		html += '<tr>';
    137 		html += '<td class="text-left">'+data.data.date_added+'</td>';
    138 		html += '<td class="text-left">payment</td>';
    139 		html += '<td class="text-left">'+data.data.amount+'</td>';
    140 		html += '</tr>';
    141 
    142 		$('#firstdata_transactions').append(html);
    143 		$('#firstdata_total_captured').text(data.data.total_formatted);
    144 
    145 		if (data.data.capture_status == 1) {
    146 		$('#button-void').hide();
    147 		$('#button-refund').show();
    148 		$(' . capture_text').text('{{ text_yes }}');
    149 		} else {
    150 		$('#button-capture').show();
    151 		}
    152 
    153 		if (data.msg != '') {
    154 		$('#firstdata_transaction_msg').empty().html('<i class="fa fa-check-circle"></i> '+data.msg).fadeIn();
    155 		}
    156 		}
    157 		if (data.error == true) {
    158 		alert(data.msg);
    159 		$('#button-capture').show();
    160 		}
    161 
    162 		$('#img_loading_capture').hide();
    163 		}
    164 		});
    165 	}
    166 });
    167 
    168 $('#button-refund').bind('click', function () {
    169 	if (confirm('{{ text_confirm_refund }}')) {
    170 		$.ajax({
    171 		type:'POST',
    172 		dataType: 'json',
    173 		data: {'order_id': {{ order_id }} },
    174 		url: 'index.php?route=extension/payment/firstdata_remote/refund&user_token={{ user_token }}',
    175 		beforeSend: function() {
    176 		$('#button-refund').hide();
    177 		$('#img_loading_refund').show();
    178 		$('#firstdata_transaction_msg').hide();
    179 		},
    180 		success: function(data) {
    181 		if (data.error == false) {
    182 		html = '';
    183 		html += '<tr>';
    184 		html += '<td class="text-left">'+data.data.date_added+'</td>';
    185 		html += '<td class="text-left">refund</td>';
    186 		html += '<td class="text-left">'+data.data.amount+'</td>';
    187 		html += '</tr>';
    188 
    189 		$('#firstdata_transactions').append(html);
    190 		$('#firstdata_total_captured').text(data.data.total_captured);
    191 
    192 		if (data.data.refund_status == 1) {
    193 		$(' . refund_text').text('{{ text_yes }}');
    194 		} else {
    195 		$('#button-refund').show();
    196 		}
    197 
    198 		if (data.msg != '') {
    199 		$('#firstdata_transaction_msg').empty().html('<i class="fa fa-check-circle"></i> '+data.msg).fadeIn();
    200 		}
    201 		}
    202 		if (data.error == true) {
    203 		alert(data.msg);
    204 		$('#button-refund').show();
    205 		}
    206 
    207 		$('#img_loading_refund').hide();
    208 		}
    209 		});
    210 	}
    211 });
    212 //--></script>