Quick Unformatted Example

  • Step 1: Copy the code sample to the right ( or below ).
  • Step 2: Paste to text editor or IDE.
  • Step 3: Save file as somefilename.php.
  • Step 4: Upload to your webserver.

Your demo file will look like this: Simple Example


Sign up for access to formatted versions like this:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Payment Results</title>
	
	<!-- STEP 1: JSTOKEN REQUIRED INCLUDES-->
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://jstoken.io/a/cryptoJsMin.js"></script>
    <script src="https://jstoken.io/a/tokenizer.js"></script>
	<script src="jsTokenInclude.js"></script>
	<!-- END STEP 1: JSTOKEN REQUIRED INCLUDES-->
	
</head>
<body>
    <h2>JSToken Sandbox</h2>
	
	<!--OPTIONAL TOKEN DISPLAY-->
    <div id="tokenMessage" style="text-align: left; word-wrap: break-word; white-space: normal;"></div>

    <form id="paymentForm">
        <label for="ccName">Cardholder Name:</label>
        <input type="text" id="ccName" name="ccName" value="John Doe" required><br><br>

        <label for="ccAmt">Amount:</label>
        <input type="text" id="ccAmt" name="ccAmt" required><br><br>

        <label for="ccNum">Credit Card Number:</label>
        <input type="text" id="ccNum" name="ccNum" value="4111111111111111" readonly><br><br>

        <label for="ccExp">Exp Date (MM/YY):</label>
        <input type="text" id="ccExp" name="ccExp" value="12/30" readonly><br><br>

        <label for="ccCvv">CVV:</label>
        <input type="text" id="ccCvv" name="ccCvv" value="999" readonly><br><br>

        <label for="ccZip">Zip Code:</label>
        <input type="text" id="ccZip" name="ccZip" value="90210" readonly><br><br>

		<!-- STEP 2: MAKE SUBMIT BUTTON ID = cycleSubmit -->
        <div><button type="submit" id="cycleSubmit" class="btn btn-success">Pay Now</button></div> 
		<!-- END STEP 2: MAKE SUBMIT BUTTON ID = cycleSubmit -->
		
		<!-- STEP 3: REQUIED HIDDEN FIELDS --> 
		<input type="hidden" id="secureKey" name="secureKey" value="GeneratedSecureKey">
		<input type="hidden" id="iv" name="iv" value="GeneratedIV">
		<input type="hidden" id="accession" name="accession" value="GeneratedAccession">
		<!--END STEP 3: REQUIED HIDDEN FIELDS --> 
		
    </form>
	
	<!--OPTIONAL JSTOKEN AND GATEWAY RESPONSES FOR DEBUGGING -->

    <div id="responseMessage"></div>
   
   
</body>
</html>