Uncaught Error: Call to undefined method Unirest\Request::enableRetries() ... BaseApi.php:64

When using the square-php-sdk all I get is that error message.

Uncaught Error: Call to undefined method Unirest\Request::enableRetries() in /home/xxx/xxx/xxx/square-web-payments/src/Apis/BaseApi.php:64

autoload.php contains:

    "Square\\" => "/src/",
    "apimatic\\jsonmapper\\" => "/jsonmapper/src/",
    // This is the Namespace and location from Apimatic/Unirest's composer.json
     "Unirest\\" =>  "/unirest-php/src/Unirest/",
];

The paths are correct. If I change the Unirest path I get an error it can’t be found so it is loading correctly.

:wave: What endpoint are you calling when you get this error? Also what’s the application ID? :slightly_smiling_face:

I am trying what it here:

And any call I make returns that error.

AppId: sandbox-sq0idb-lQ4OdpcNgpXrggf0T6mc6Q

Did I not give you enough information with my reply?

Seems like you guys would be on this since you are removing sqPayemtForm in less than a week. I have a couple of hundred Square users that are going to be pissed the 21st.

1 Like

Let me add this, this is what I am following that is generating the errors:

An issue with Unirest. So I can’t get any furter.

The team is looking into this. :slightly_smiling_face:

Yup, losing thousands a day. This is killing my business

@bdg2017 Could you elaborate what your issue on what your issue is? This is a very old thread. Any additional information would be helpful. :slightly_smiling_face:

Have you confirmed that you’re getting the token prior to passing it to the payment request? That error is saying that it’s null. Is it even being generated? :slightly_smiling_face:

No clue if I’m getting the token. Haven’t done or need to do anything in php in over 8 years. Trying to figure this out quickly. How can I tell if I’m getting the token? Is there paid support somewhere? I need the form → Process payment .

Is there a way to see the if the token is being generated on the form page?

If you inspect the page and go to the network is token being called and returning the source_id is the response? :slightly_smiling_face:

When I change the form payment-process.php to /payment I get


JSON.parse: unexpected character at line 1 column 1 of the JSON data [square.js:1:94027](https://sandbox.web.squarecdn.com/v1/square.js)

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

handlePaymentMethodSubmission https://www.bigdippergraphics.com/public/examples/card.php:120

<anonymous> https://www.bigdippergraphics.com/public/examples/card.php:126

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

(Async: EventListener.handleEvent)
It https://sandbox.web.squarecdn.com/v1/square.js:1

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

<anonymous> https://www.bigdippergraphics.com/public/examples/card.php:125

<anonymous> https://www.bigdippergraphics.com/public/examples/card.php:80