Stripe Custom Integration Code Syntax Error
Does any one know why the following code produces a DreamWeaver syntax error for the input type line of code following the form closure tag?
//JavaScript Document
<form id="myForm" action="XXXXXX" method="POST">
<input type="text" id="amount" name="amount" />
<input type="hidden" id="stripeToken" name="stripeToken" />
<input type="hidden" id="stripeEmail" name="stripeEmail" />
<input type="hidden" id="amount" name="amount" />
</form>
<input type="button" id="customButton" value="Pay">
var handler = StripeCheckout.configure({
key: 'pk_test_hxEmKqbOV4MKCIw0PcbUgdqX',
image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
token: function (token) {
$("#stripeToken").val(token.id);
$("#stripeEmail").val(token.email);
$("#amount").val($("#amount").val() * 100);
$("#myForm").submit();
}
});
$('#customButton').on('click', function (e) {
var amount = $("#amount").val() * 100;
var displayAmount = parseFloat(Math.floor($("#amount").val() * 100) / 100).toFixed(2);
// Open Checkout with further options
handler.open({
name: 'Demo Site',
description: 'Custom amount ($' + displayAmount + ')',
amount: amount
});
e.preventDefault();
});
// Close Checkout on page navigation
$(window).on('popstate', function () {
handler.close();
});
</body>
</html>
Thanks!
O
