shop.balmet.com

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

globalpay_order.twig (8415B)


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