shop.balmet.com

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

globalpay_remote_order.twig (8333B)


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