Issue with integrating Square online payments with my website

A few things:

  1. Please do not share your access token with anyone; I’ve removed it but that’s a big security concern.
  2. No where in your code have you set the sandbox host domain, which is why you’re seeing this error (you’re using sandbox access token + location id but hitting production urls).
  3. You would need to do something like \SquareConnect\Configuration::getDefaultConfiguration()->setHost("https://connect.squareupsandbox.com"); to fix the error.
  4. You’re using a very outdated (and deprecated SDK); you probably want to also migrate to our new SDK at some point: GitHub - square/square-php-sdk: PHP client library for the Square API
  5. Our examples do use the new Payments API and new SDK, so I’m not sure where you got the deprecated code from: connect-api-examples/connect-examples/v2/php_payment at master · square/connect-api-examples · GitHub

Please let me know if you have additional questions or concerns!