Error when running PHP Payment test

I have been successful up to this point integrating PHP Payments into my website. I ran a test payment earlier today and got several successful payment messages. Now all of a sudden I get a syntax error when I try a test payment. See the screenshot from my developer tools:

squarePHPPayments_error

Where is square.js? I don’t find it anywhere.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Troubleshoot In-App Payments SDK Problems
Make your First API Call
Guidelines and Limitations

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The error message you’re seeing is a syntax error, which means there’s an issue with the code you’re using. This could be due to a variety of reasons such as a missing bracket, incorrect use of a function, or a typo in your code. It’s hard to provide a specific solution without seeing the actual code, but I would recommend going back to the section of your code where you’re handling the payment process and carefully checking for any syntax mistakes.

This answer was reviewed by @Bryan-Square.

One thing to double-check is that you’re using the script that square supplies to you to process payment.

When I setup my payment system on my website with square about 8 months ago, the script I use for the live production environment is:

https://web.squarecdn.com/v1/square.js

and for the sandbox environment:

https://sandbox.web.squarecdn.com/v1/square.js

If you’re using square.js from some other location, it may be corrupted (or not even meant for square) which can cause the errors such as the one you see.