x

SqPaymentForm doesn't load any input fields, only the labels, what am I missing?

SqPaymentForm doesn't load any input fields, only the labels, what am I missing? I copied the sample form code to a new page.

Tags (1)
7,763 Views
Message 1 of 10
Report
9 REPLIES 9
Alumni

Did you forget the

<script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script>
7,731 Views
Message 2 of 10
Report

Nope, its at the top of the page, I copied the sample in its entirety.  Also I get no errors.

7,728 Views
Message 3 of 10
Report
Alumni

Hmm, that does'nt seem right!

 

Can you share a screenshot?

7,716 Views
Message 4 of 10
Report

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/square.JPG

7,713 Views
Message 5 of 10
Report
Alumni

If you open up you javascript console, you should see this error: 

Screen Shot 2016-12-12 at 2.26.14 PM.png

 

You need to serve your pages from https for security reasons, but you can test on localhost for development. 

7,698 Views
Message 6 of 10
Report

so am i to understand the page will not run if not https?

 

7,694 Views
Message 7 of 10
Report
Alumni

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. 

7,689 Views
Message 8 of 10
Report

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?

7,687 Views
Message 9 of 10
Report
Alumni

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. 

7,684 Views
Message 10 of 10
Report