Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (42 sloc) 1.53 KB
<!--Example checkout form with client-side encryption. For help, see http://developers.bluesnap.com/docs/client-side-encryption-->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<!--Insert the relevant URL for the form action-->
<form action="your-form-handling-page" method="POST" id="checkout-form">
<div>
<label for="FirstName">Name on Card</label>
<input type="text" name="cardholder-name" id="cardholder-name">
</div>
<!--Note the data-bluesnap attribute-->
<div>
<label for="creditCard">Card Number</label>
<input type="text" name="creditCard" id="creditCard" data-bluesnap="encryptedCreditCard">
</div>
<!--Note the data-bluesnap attribute-->
<div>
<label for="cvv">Security Code</label>
<input type="text" name="cvv" id="cvv" data-bluesnap="encryptedCvv">
</div>
<div>
<label for="Expiration">Exp. (MM/YYYY)</label>
<input type="text" name="exp-month" id="exp-month" size="2">
<span> / </span>
<input type="text" name="exp-year" id="exp-year" size="4">
</div>
<button type="submit" id="submit-button">Buy Now</button>
</form>
<!--Adds the BlueSnap JavaScript library-->
<script src="https://gateway.bluesnap.com/js/cse/v1.0.3/bluesnap.js"></script>
<!--Creates the BlueSnap object, instantiates it with your public key, and enables encryption on submit-->
<script>
var bluesnap = new BlueSnap("YOUR_PUBLIC_CSE_KEY");
document.getElementById("submit-button").addEventListener("click", function(){
bluesnap.encrypt("checkout-form");
});
</script>
</body>
</html>