cardentryform.twig 1.2 KB

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