Blame view

modules/OfflinePayment/Resources/views/show.blade.php 1.29 KB
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  <h2>{{ $gateway['name'] }}</h2>
  
  @if ($gateway['description'])
  <div class="well well-sm">
      {{ $gateway['description'] }}
  </div>
  @endif
  <div class="buttons">
      <div class="pull-right">
          <input type="button" value="{{ trans('offlinepayment::offlinepayment.confirm') }}" id="button-confirm" class="btn btn-success" data-loading-text="{{ trans('offlinepayment::offlinepayment.loading') }}" />
      </div>
  </div>
  <script type="text/javascript"><!--
      $('#button-confirm').on('click', function() {
          $.ajax({
              url: '{{ url("customers/invoices/" . $invoice->id . "/offlinepayment/confirm") }}',
              type: 'POST',
              dataType: 'JSON',
              data: {payment_method: '{{ $gateway['code'] }}'},
              cache: false,
              headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
              beforeSend: function() {
                  $('#button-confirm').button('loading');
              },
              complete: function() {
                  $('#button-confirm').button('reset');
              },
              success: function(data) {
                  if (data['error']) {
                      alert(data['error']);
                  }
  
                  if (data['success']) {
                      location.reload();
                  }
              }
          });
      });
      //--></script>