shop.balmet.com

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

realex_order.twig (8337B)


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