cardentryform.twig 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script>
  2. <script type="text/javascript" src="/extensions/vendor/ginger/squarepay/sq-paymentform.js?v=2018-10-30-a"></script>
  3. <script>
  4. // For sq-paymentform.js
  5. var applicationId = '{{ config.testmode ? config.sq_sandbox_app_id : config.sq_app_id }}';
  6. var locationId = '{{ config.testmode ? config.sq_sandbox_location_id : config.sq_location_id }}';
  7. </script>
  8. <div id="card-error-area" class="{{ error | length ?: 'hidden' }}">
  9. {% for err in error %}
  10. {{ err.detail }} <small>( {{ err.code | lower }} )</small><br>
  11. {% endfor %}
  12. </div>
  13. <div id="cc-form">
  14. <form id="nonce-form" novalidate action="/process-square" method="post">
  15. <input type="hidden" id="card-nonce" name="nonce">
  16. <div class="cc-row">
  17. <label>Name</label>
  18. <input type="text" name="name">
  19. </div>
  20. <div class="cc-row">
  21. <label>Email</label>
  22. <input type="email" name="email">
  23. </div>
  24. <div class="cc-row">
  25. <label>Date of Booking</label>
  26. <input type="date" name="date" placeholedr="dd/mm/yy" min="{{ 'now' | date('Y-m-d') }}" max="2019-12-31">
  27. </div>
  28. <div class="cc-row">
  29. <label>Name of Booker</label>
  30. <input type="text" name="booker">
  31. </div>
  32. <div class="cc-row">
  33. <label>Card Number</label>
  34. <div id="sq-card-number"></div>
  35. </div>
  36. <div class="cc-row">
  37. <label>Card Expiry Date</label>
  38. <div id="sq-expiration-date"></div>
  39. </div>
  40. <div class="cc-row">
  41. <label>CVV <small>(see back of card)</small></label>
  42. <div id="sq-cvv"></div>
  43. </div>
  44. <div class="cc-row">
  45. <label>Postcode</label>
  46. <div id="sq-postal-code"></div>
  47. </div>
  48. <div class="cc-row">
  49. <label></label>
  50. <a class="ecom-button" onclick="requestCardNonce(event)">Complete Order</a>
  51. </div>
  52. </form>
  53. </div>