Unexpected token is not valid JSON

We are trying to implement the Web Payments SDK (PHP).

We are receiving the following error message executing card.html or card.php.

ERROR MESSAGE:

Unexpected token ‘<’, “
”… is not valid JSON

Thank you an advance for your assistance.

1 Like

If you print the request that you’re passing to Square what does it look like? Does it have the source_id? Also have you checked your API Logs? :slightly_smiling_face:

We spent an entire day trying yesterday trying to solve this matter.

Several of Square Web Development team members connected us via Google Meets, but we are still not able today to implement the Web Payments SDK.

We are trying to implement the Web Payments SDK because SQPaymentForm library has been depreciated in May of this year.

However, can we continue to use the SqPaymentForm? Or, is there a workaround?

Currently, our SqPaymentForm used for many years is now unable to accept card information from our clients. It’s actually disabled not allowing for client card entries.

We are willing to pay anyone hourly to help us implement the Web Payments SDK or help us with a workaround for SqPaymentForm.

Thank you in advance for your assistance, support and feedback.

What issues are you running into with the migration? If you follow the steps in our migration guide it should be pretty straight forward. :slightly_smiling_face:

Bryan,

Thank you for your feedback.

However, can we continue to use SqPaymentForm without migrating to the Web Payments SDK?

Currently, the SqPaymentForm do not allow us to enter card information. It just stopped working for many of our clients.

Again, thanks!

The SqPaymentForm is now retired. It was deprecated as of May 13, 2021, and was scheduled to be retired on July 20, 2022 but that got extended to October 31, 2022. You’ll need to migrate to the Web Payments SDK . The SqPaymentForm should not be relied on. :slightly_smiling_face:

Bryan,

Is there someone or a partner of Square we can pay hourly to assist us?

You can definitely reach out to one of our Square Specialists. :slightly_smiling_face:

Was there a resolution to your problem? I am getting the same Error Message.