bank-transfer.blade.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <tr>
  2. <td>
  3. @if(isset($payment['name']))
  4. {{ ucwords($payment['name']) }}
  5. @else
  6. <p class="alert alert-danger">You need to have <strong>name</strong> key in your config</p>
  7. @endif
  8. </td>
  9. <td>
  10. @if(isset($payment['description']))
  11. {{ $payment['description'] }}
  12. @endif
  13. </td>
  14. <td>
  15. <form action="{{ route('bank-transfer.index') }}">
  16. <input type="hidden" class="billing_address" name="billing_address" value="">
  17. <input type="hidden" class="rate" name="rate" value="">
  18. <input type="hidden" name="shipment_obj_id" value="{{ $shipment_object_id }}">
  19. <button type="submit" class="btn btn-warning pull-right">Pay with {{ ucwords($payment['name']) }} <i class="fa fa-bank"></i></button>
  20. </form>
  21. </td>
  22. </tr>
  23. <script type="text/javascript">
  24. $(document).ready(function () {
  25. let billingAddressId = $('input[name="billing_address"]:checked').val();
  26. $('.billing_address').val(billingAddressId);
  27. $('input[name="billing_address"]').on('change', function () {
  28. billingAddressId = $('input[name="billing_address"]:checked').val();
  29. $('.billing_address').val(billingAddressId);
  30. });
  31. let courierRadioBtn = $('input[name="rate"]');
  32. courierRadioBtn.click(function () {
  33. $('.rate').val($(this).val())
  34. });
  35. });
  36. </script>