bluepay_hosted_order.twig (8552B)
1 <h2>{{ text_payment_info }}</h2> 2 <div class="alert alert-success" id="payment_bluepay_hosted_transaction_msg" style="display:none;"></div> 3 <table class="table table-striped table-bordered"> 4 <tr> 5 <td>{{ text_order_ref }}</td> 6 <td>{{ bluepay_hosted_order.transaction_id }}</td> 7 </tr> 8 <tr> 9 <td>{{ text_order_total }}</td> 10 <td>{{ bluepay_hosted_order.total_formatted }}</td> 11 </tr> 12 <tr> 13 <td>{{ text_total_released }}</td> 14 <td id="bluepay_hosted_total_released">{{ bluepay_hosted_order.total_released_formatted }}</td> 15 </tr> 16 <tr> 17 <td>{{ text_release_status }}</td> 18 <td id="release_status">{% if bluepay_hosted_order.release_status == 1 %} 19 <span class="release_text">{{ text_yes }}</span> 20 {% else %} 21 <span class="release_text">{{ text_no }}</span> 22 {% if bluepay_hosted_order.void_status == 0 %} 23 <input type="text" width="10" id="release_amount" value="{{ bluepay_hosted_order.total }}"/> 24 <a class="button btn btn-primary" id="button-release">{{ button_release }}</a> <span class="btn btn-primary" id="img_loading_release" style="display:none;"><i class="fa fa-circle-o-notch fa-spin fa-lg"></i></span> 25 {% endif %} 26 {% endif %}</td> 27 </tr> 28 <tr> 29 <td>{{ text_void_status }}</td> 30 <td id="void_status"> 31 {% if bluepay_hosted_order.void_status == 1 %} 32 <span class="void_text">{{ text_yes }}</span> 33 {% elseif bluepay_hosted_order.void_status == 0 and bluepay_hosted_order.release_status == 1 and bluepay_hosted_order.rebate_status != 1 %} 34 <span class="void_text">{{ text_no }}</span> <a class="button 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 {% else %} 36 <span class="void_text">{{ text_no }}</span> 37 {% endif %}/td> 38 </tr> 39 <tr> 40 <td>{{ text_rebate_status }}</td> 41 <td id="rebate_status"> 42 {% if bluepay_hosted_order.rebate_status == 1 %} 43 <span class="rebate_text">{{ text_yes }}</span> 44 {% else %} 45 <span class="rebate_text">{{ text_no }}</span> 46 {% if bluepay_hosted_order.total_released > 0 and bluepay_hosted_order.void_status == 0 %} 47 <input type="text" width="10" id="rebate_amount" /> 48 <a class="button btn btn-primary" id="button-rebate">{{ button_rebate }}</a> <span class="btn btn-primary" id="img_loading_rebate" style="display:none;"><i class="fa fa-circle-o-notch fa-spin fa-lg"></i></span> 49 {% endif %} 50 {% endif %}</td> 51 </tr> 52 <tr> 53 <td>{{ text_transactions }}:</td> 54 <td><table class="table table-striped table-bordered" id="bluepay_hosted_transactions"> 55 <thead> 56 <tr> 57 <td class="text-left"><strong>{{ text_column_date_added }}</strong></td> 58 <td class="text-left"><strong>{{ text_column_type }}</strong></td> 59 <td class="text-left"><strong>{{ text_column_amount }}</strong></td> 60 </tr> 61 </thead> 62 <tbody> 63 {% for transaction in bluepay_hosted_order.transactions %} 64 <tr> 65 <td class="text-left">{{ transaction.date_added }}</td> 66 <td class="text-left">{{ transaction.type }}</td> 67 <td class="text-left">{{ transaction.amount }}</td> 68 </tr> 69 {% endfor %} 70 </tbody> 71 </table></td> 72 </tr> 73 </table> 74 <script type="text/javascript"><!-- 75 $(document).on('click', '#button-void', function(){ 76 if (confirm('{{ text_confirm_void }}')) { 77 $.ajax({ 78 type: 'POST', 79 dataType: 'json', 80 data: {'order_id': {{ order_id }}}, 81 url: 'index.php?route=extension/payment/bluepay_hosted/void&user_token={{ user_token }}', 82 beforeSend: function() { 83 $('#button-void').hide(); 84 $('#img_loading_void').show(); 85 $('#bluepay_hosted_transaction_msg').hide(); 86 }, 87 success: function(data) { 88 if (data.error == false) { 89 html = ''; 90 html += '<tr>'; 91 html += '<td class="text-left">' + data.data.date_added + '</td>'; 92 html += '<td class="text-left">void</td>'; 93 html += '<td class="text-left">' + data.data.total + '</td>'; 94 html += '</tr>'; 95 96 $('.void_text').text('{{ text_yes }}'); 97 $('.rebate_text').text('{{ text_no }}'); 98 $('#bluepay_hosted_transactions').append(html); 99 $('#button-release').hide(); 100 $('#release_amount').hide(); 101 $('#button-rebate').hide(); 102 $('#rebate_amount').hide(); 103 104 if (data.msg != '') { 105 $('#bluepay_hosted_transaction_msg').empty().html('<i class="fa fa-check-circle"></i> ' + data.msg).fadeIn(); 106 } 107 } 108 if (data.error == true) { 109 alert(data.msg); 110 $('#button-void').show(); 111 } 112 113 $('#img_loading_void').hide(); 114 } 115 }); 116 } 117 }); 118 $(document).on('click', '#button-release', function(){ 119 if (confirm('{{ text_confirm_release }}')) { 120 $.ajax({ 121 type: 'POST', 122 dataType: 'json', 123 data: {'order_id': {{ order_id }}, 'amount': $('#release_amount').val()}, 124 url: 'index.php?route=extension/payment/bluepay_hosted/release&user_token={{ user_token }}', 125 beforeSend: function() { 126 $('#button-release').hide(); 127 $('#release_amount').hide(); 128 $('#img_loading_release').show(); 129 $('#bluepay_hosted_transaction_msg').hide(); 130 }, 131 success: function(data) { 132 if (data.error == false) { 133 html = ''; 134 html += '<tr>'; 135 html += '<td class="text-left">' + data.data.date_added + '</td>'; 136 html += '<td class="text-left">payment</td>'; 137 html += '<td class="text-left">' + data.data.amount + '</td>'; 138 html += '</tr>'; 139 140 $('#bluepay_hosted_transactions').append(html); 141 $('#bluepay_hosted_total_released').text(data.data.total); 142 143 if (data.data.release_status == 1) { 144 $('.void_text').after('<a style="margin-left: 10px;" id="button-void" class="button btn btn-primary">Void</a>'); 145 $('.rebate_text').after('<input style="margin-left: 10px;" width="10" type="text" id="rebate_amount"><a style="margin-left: 5px;" id="button-rebate" class="button btn btn-primary">Rebate / refund</a>'); 146 $('.release_text').text('{{ text_yes }}'); 147 $('#rebate_amount').val(0.00).show(); 148 } else { 149 $('#button-release').show(); 150 $('#release_amount').val(0.00); 151 } 152 153 if (data.msg != '') { 154 $('#bluepay_hosted_transaction_msg').empty().html('<i class="fa fa-check-circle"></i> ' + data.msg).fadeIn(); 155 } 156 157 $('#button-rebate').show(); 158 $('#rebate_amount').val(0.00).show(); 159 } 160 if (data.error == true) { 161 alert(data.msg); 162 $('#button-release').show(); 163 $('#release_amount').show(); 164 } 165 166 $('#img_loading_release').hide(); 167 } 168 }); 169 } 170 }); 171 $(document).on('click', '#button-rebate', function(){ 172 if (confirm('{{ text_confirm_rebate }}')) { 173 $.ajax({ 174 type: 'POST', 175 dataType: 'json', 176 data: {'order_id': {{ order_id }}, 'amount': $('#rebate_amount').val()}, 177 url: 'index.php?route=extension/payment/bluepay_hosted/rebate&user_token={{ user_token }}', 178 beforeSend: function() { 179 $('#button-rebate').hide(); 180 $('#rebate_amount').hide(); 181 $('#img_loading_rebate').show(); 182 $('#bluepay_hosted_transaction_msg').hide(); 183 }, 184 success: function(data) { 185 if (data.error == false) { 186 html = ''; 187 html += '<tr>'; 188 html += '<td class="text-left">' + data.data.date_added + '</td>'; 189 html += '<td class="text-left">rebate</td>'; 190 html += '<td class="text-left">' + data.data.amount + '</td>'; 191 html += '</tr>'; 192 193 $('#bluepay_hosted_transactions').append(html); 194 $('#bluepay_hosted_total_released').text(data.data.total_released); 195 196 if (data.data.rebate_status == 1) { 197 $('.rebate_text').text('{{ text_yes }}'); 198 $('#button-void').hide(); 199 } else { 200 $('#button-rebate').show(); 201 $('#rebate_amount').show(); 202 } 203 204 if (data.msg != '') { 205 $('#bluepay_hosted_transaction_msg').empty().html('<i class="fa fa-check-circle"></i> ' + data.msg).fadeIn(); 206 } 207 } 208 if (data.error == true) { 209 alert(data.msg); 210 $('#button-rebate').show(); 211 $('#rebate_amount').show(); 212 } 213 214 $('#img_loading_rebate').hide(); 215 } 216 }); 217 } 218 }); 219 //--></script>