如何确认您正在连接Square API - 示例脚本问题?

I am going by the PHP Square Connect example here:

example

It appears to die at line 40:

$transactions_api = new \SquareConnect\Api\TransactionsApi();

I suspect my setup. Is there a way to check that you are actually communicating with the API properly?


More Info: I turned on php error reporting with

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

And now I get:

Notice: Undefined variable: location in my_path/st.php on line 283

and

Fatal error: Call to a member function getId() on null in my_path/st.php on line 283

Seems like a problem with either the API or the example. I had a similar problem with the Square Connect Example where it had bad lines:

Checkout API Setup Guide references commands that kill test pages AND do not exist in API

OK, looks like this line was the problem:

$result = $transactions_api->charge($location->getId(), $request_body);

it should be:

$result = $transactions_api->charge($location_id, $request_body);

So getId is not required. That is how the example listed the line so my bad. Must have gotten that line from somewhere else on Git. Honestly, Square has the worst install/examples ever. Thanks.