Initial testing of my code

I must have done something really bad because when I attempt to pay to my sandbox account I don’t get an error per se, but if I show my javascript code (I’m using Firefox so I do the key stroke combo Ctrl-Shift-k) it looks like there is no such page as “http://localhost/payment”. It might have something with my not knowing how to create an actual Square localhost site, so maybe we could begin there. I have no idea how to download the sample project that comes from GitHub.

Thanks in advance,

I have one additional question. In the documentation for how to do this, there is no mention of where you place the dollar amount you want to charge to the card. The button text6 says “Pay $1.00” but that is only for show. Where do you place the actual amount? And what about the place for “Name on the card” like other eCommerce sites have?


Do these questions get reviewed by anyone? I would like someone to help me with my problem.


I’m not sure I fully understand the question. Are you expecting an error? Also our example has the amount hard coded in it. If you’d like to pass an amount to the payment request we recommend that you use the Orders API. :slightly_smiling_face:

The first part of this tefers to how to install a payments website in my localhost, I think. I have never used github for anything before. I want to be able to test out my payment code.

I received your response pertaining to creating an order with the Order Api and will be trying that next. But I still need to be able to test everything.

Right, our example code allows you to test payments using localhost. :slightly_smiling_face:

But my question is how to install the payments website!

Once you’ve completed testing on localhost you can deploy to your server for processing payment on your custom site. Or are you using a hosting provider that has a Square integration for processing payments? :slightly_smiling_face:

I don’t know how to install the payments website in localhost

Square APIs are designed for integration into custom applications, and a certain level of developer expertise is recommended for implementation. To effectively utilize our APIs, a good understanding of web development, programming languages, and API integrations is essential. If you or your team are not familiar with these technical aspects, it might be beneficial to involve a developer or technical resource to ensure a smooth integration process or we recommend connecting your Square account with one of our eCommerce partners.:slightly_smiling_face:

Did you see my initial question? I do not know what to do with github!! I have been developing websites for over 25 years. I need help with the github only.

What issues are you having with GitHub? Are you trying to clone or download the repo? :slightly_smiling_face:

Whatever has to be done to get the payments website. I do not know what to do with github.

I manually downloaded the javascript code that goes into my web page so that works.

Right now, when I click the pay button, there is an error at the line http://localhost/payments saying that it doesn’t exist.

Can you look at my initial posting? That is exactly what I said there.

The javascript is the frontend code. Did you also pull in the server side code? The error your getting is because the example is looking for the /payment in the server.js file of the example. :slightly_smiling_face:

I know. I don’t know: 1. Where the server code is and 2. How to download it. Once I can do that, I can create a new website in IIS and point it to inetpub/wwwroot/payment.

You’ll need to clone the entire repo to get the server side code. You can do so from git by choosing one of they ways to clone the repo:

I will try it first thing tomorrow morning. Thanks

I downloaded the file and unzipped it into my inetpub\wwwroot folder. That gives me this:



Are you going to reply today, maybe? I am stuck and cannot proceed.


What step of the are you stuck on? Now that you have the whole repo cloned you can test taking a payment. :slightly_smiling_face: