eway_order.twig (6060B)
1 <h2>{{ text_payment_info }}</h2> 2 <div class="alert alert-success" id="eway-transaction-msg" style="display:none;"></div> 3 <table class="table table-striped table-bordered"> 4 <tr> 5 <td>{{ text_order_total }}</td> 6 <td colspan="2">{{ eway_order.total_formatted }}</td> 7 </tr> 8 <tr> 9 <td>{{ text_total_captured }}</td> 10 <td id="eway-total-captured">{{ eway_order.total_captured_formatted }}</td> 11 <td> 12 {% if eway_order.void_status == 0 and eway_order.capture_status == 0 %} 13 <input type="text" name="eway_capture_amount" placeholder="{{ eway_order.uncaptured }}" id="eway-capture-amount" class="" /> 14 <a class="button btn btn-primary" id="btn-capture">{{ btn_capture }}</a> 15 <span class="btn btn-primary" id="img-loading-capture" style="display:none;"><i class="fa fa-cog fa-spin fa-lg"></i></span> 16 {% endif %} 17 </td> 18 </tr> 19 <tr> 20 <td>{{ text_total_refunded }}</td> 21 <td id="eway-total-refunded">{{ eway_order.total_refunded_formatted }}</td> 22 <td> 23 {% if eway_order.refund_status == 0 and eway_order.capture_status == 1 %} 24 <input type="text" name="eway_refund_amount" placeholder="{{ eway_order.unrefunded }}" id="eway-refund-amount" class="" /> 25 <a class="button btn btn-primary" id="btn-refund">{{ btn_refund }}</a> 26 <span class="btn btn-primary" id="img-loading-refund" style="display:none;"><i class="fa fa-cog fa-spin fa-lg"></i></span> 27 {% endif %} 28 </td> 29 </tr> 30 <tr> 31 <td>{{ text_transactions }}:</td> 32 <td colspan="2"> 33 <table class="table table-striped table-bordered" id="eway-transactions"> 34 <thead> 35 <tr> 36 <td class="text-left"><strong>{{ text_column_transactionid }}</strong></td> 37 <td class="text-left"><strong>{{ text_column_created }}</strong></td> 38 <td class="text-left"><strong>{{ text_column_type }}</strong></td> 39 <td class="text-left"><strong>{{ text_column_amount }}</strong></td> 40 </tr> 41 </thead> 42 <tbody> 43 {% for transaction in eway_order.transactions %} 44 <tr> 45 <td class="text-left">{{ transaction.transaction_id }}</td> 46 <td class="text-left">{{ transaction.created }}</td> 47 <td class="text-left">{{ transaction.type }}</td> 48 <td class="text-left">{{ transaction.amount }}</td> 49 </tr> 50 {% endfor %} 51 </tbody> 52 </table> 53 </td> 54 </tr> 55 </table> 56 57 <script type="text/javascript"><!-- 58 $("#btn-refund").bind('click', function () { 59 if ($('#eway-refund-amount').val() != '' && confirm('{{ text_confirm_refund }}')) { 60 $.ajax({ 61 type:'POST', 62 dataType: 'json', 63 data: { 64 'order_id': {{ order_id }}, 65 'refund_amount': $("#eway-refund-amount").val() 66 }, 67 url: 'index.php?route=extension/payment/eway/refund&user_token={{ user_token }}', 68 beforeSend: function(xhr, opts) { 69 $('#btn-refund').hide(); 70 $('#img-loading-refund').show(); 71 $('#eway-transaction-msg').hide(); 72 $('#eway-refund-amount').hide(); 73 }, 74 success: function(data) { 75 if (data.error == false) { 76 html = ''; 77 html += '<tr>'; 78 html += '<td class="text-left">'+data.data.transactionid+'</td>'; 79 html += '<td class="text-left">'+data.data.created+'</td>'; 80 html += '<td class="text-left">refund</td>'; 81 html += '<td class="text-left">'+data.data.amount+'</td>'; 82 html += '</tr>'; 83 $('#eway-transactions tr:last').after(html); 84 85 $('#eway-total-refunded').text(data.data.total_refunded_formatted); 86 87 if (data.data.refund_status != 1) { 88 $('#btn-refund').show(); 89 $('#eway-refund-amount').show(); 90 $('#eway-refund-amount').val(''); 91 $('#eway-refund-amount').attr('placeholder',data.data.remaining); 92 } 93 94 if (data.message != '') { 95 $('#eway-transaction-msg').empty().html('<i class="fa fa-check-circle"></i> '+data.message).fadeIn(); 96 } 97 } 98 if (data.error == true) { 99 alert(data.message); 100 $('#btn-refund').show(); 101 $('#eway-refund-amount').show(); 102 } 103 104 $('#img-loading-refund').hide(); 105 } 106 }); 107 } 108 }); 109 //--> 110 </script> 111 <script type="text/javascript"><!-- 112 $("#btn-capture").bind('click', function () { 113 if ($('#eway-capture-amount').val() != '' && confirm('{{ text_confirm_capture }}')) { 114 $.ajax({ 115 type:'POST', 116 dataType: 'json', 117 data: { 118 'order_id': {{ order_id }}, 119 'capture_amount': $("#eway-capture-amount").val() 120 }, 121 url: 'index.php?route=extension/payment/eway/capture&user_token={{ user_token }}', 122 beforeSend: function(xhr, opts) { 123 $('#btn-capture').hide(); 124 $('#img-loading-capture').show(); 125 $('#eway-transaction-msg').hide(); 126 $('#eway-capture-amount').hide(); 127 }, 128 success: function(data) { 129 if (data.error == false) { 130 html = ''; 131 html += '<tr>'; 132 html += '<td class="text-left">'+data.data.transactionid+'</td>'; 133 html += '<td class="text-left">'+data.data.created+'</td>'; 134 html += '<td class="text-left">payment</td>'; 135 html += '<td class="text-left">'+data.data.amount+'</td>'; 136 html += '</tr>'; 137 $('#eway-transactions tr:last').after(html); 138 139 $('#eway-total-captured').text(data.data.total_captured_formatted); 140 141 if (data.data.capture_status != 1) { 142 $('#btn-capture').show(); 143 $('#eway-capture-amount').show(); 144 $("#eway-capture-amount").val(''); 145 $("#eway-capture-amount").attr('placeholder',data.data.remaining); 146 } 147 148 if (data.message != '') { 149 $('#eway-transaction-msg').empty().html('<i class="fa fa-check-circle"></i> '+data.message).fadeIn(); 150 } 151 } 152 if (data.error == true) { 153 alert(data.message); 154 $('#btn-capture').show(); 155 $('#eway-capture-amount').show(); 156 } 157 158 $('#img-loading-capture').hide(); 159 } 160 }); 161 } 162 }); 163 //--> 164 </script>