cardentryform.twig 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <h1>Credit Card Payment Form</h1>
  2. <script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script>
  3. <script type="text/javascript" src="/extensions/vendor/ginger/squarepay/sq-paymentform.js"></script>
  4. <script>
  5. // For sq-paymentform.js
  6. var isPaymentsPage = true;
  7. var applicationId = '{{ testmode ? sq_sandbox_app_id : sq_app_id }}';
  8. var locationId = '{{ testmode ? sq_sandbox_location_id : sq_location_id }}';
  9. </script>
  10. <div id="sq-ccbox">
  11. <!--
  12. You should replace the action attribute of the form with the path of
  13. the URL you want to POST the nonce to (for example, "/process-card")
  14. -->
  15. <form id="nonce-form" novalidate action="/process-square" method="post">
  16. <table>
  17. <tbody>
  18. <tr>
  19. <td>Card Number</td>
  20. <td><div id="sq-card-number"></div></td>
  21. </tr>
  22. <tr>
  23. <td>CVV</td>
  24. <td><div id="sq-cvv"></div></td>
  25. </tr>
  26. <tr>
  27. <td>Expiration Date &nbsp;</td>
  28. <td><div id="sq-expiration-date"></div></td>
  29. </tr>
  30. <tr>
  31. <td>Postal Code</td>
  32. <td><div id="sq-postal-code"></div></td>
  33. </tr>
  34. <tr>
  35. <td></td>
  36. <td>
  37. <button class="btn btn-primary" id="sq-creditcard" onclick="requestCardNonce(event)">
  38. Pay with card
  39. </button>
  40. </td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. <!-- After a nonce is generated it will be assigned to this hidden input field -->
  45. <input type="hidden" id="card-nonce" name="nonce">
  46. </form>
  47. </div>