SqPaymentForm doesn't load any input fields, only the labels, what am I missing? I copied the sample form code to a new page.
Did you forget the
<script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script>
Nope, its at the top of the page, I copied the sample in its entirety. Also I get no errors.
Hmm, that does'nt seem right!
Can you share a screenshot?
Can't figure out what is missing, here is a screen shot of the code my page generates and the top of the code in the background. This is the URL of where I got the sampe: https://docs.connect.squareup.com/articles/adding-payment-form/
If you open up you javascript console, you should see this error:
You need to serve your pages from https for security reasons, but you can test on localhost for development.
so am i to understand the page will not run if not https?
Yep! Like it says here: https://docs.connect.squareup.com/articles/adding-payment-form/
https is really important to make sure that people can't snoop on what you (or your customers!) are doing online. This is especially important to us when people are entering thier credit card information.
thanks so much, i got it working by activating a shared ssl that lets me use https. One other question, I notice the payment form has no place to put in the amount?
Correct, The amount is set when call the charge endpoint (https://docs.connect.squareup.com/api/connect/v2/#endpoint-charge). Though you probably want to put display it on the screen when people enter their credit card details as well.
Square Community