# Unexpected token is not valid JSON

**URL:** <https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557>\
**Category:** Questions\
**Created:** [November 12, 2022, 4:32am UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557 "2022-11-12T04:32:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDeveloper](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TheDeveloper](https://developer.squareup.com/forums/u/TheDeveloper)\
**Post date:** [November 12, 2022, 4:32am UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/1 "2022-11-12T04:32:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 14, 2022, 5:26pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/2 "2022-11-14T17:26:44Z")

</div>

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](https://developer.squareup.com/apps/sq0idp-1i0fjgk39-mKXW_bd3YyPA/log)? 🙂

---

<div class="post-metadata">

**Author:** ![TheDeveloper](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TheDeveloper](https://developer.squareup.com/forums/u/TheDeveloper)\
**Post date:** [November 15, 2022, 3:08pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/3 "2022-11-15T15:08:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 15, 2022, 5:47pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/4 "2022-11-15T17:47:43Z")

</div>

What issues are you running into with the migration? If you follow the steps in our [migration guide](https://developer.squareup.com/docs/web-payments/migrate) it should be pretty straight forward. 🙂

---

<div class="post-metadata">

**Author:** ![TheDeveloper](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TheDeveloper](https://developer.squareup.com/forums/u/TheDeveloper)\
**Post date:** [November 15, 2022, 7:20pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/5 "2022-11-15T19:20:41Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 15, 2022, 7:40pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/6 "2022-11-15T19:40:13Z")

</div>

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](https://developer.squareup.com/docs/web-payments/migrate). The `SqPaymentForm` should not be relied on. 🙂

---

<div class="post-metadata">

**Author:** ![TheDeveloper](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TheDeveloper](https://developer.squareup.com/forums/u/TheDeveloper)\
**Post date:** [November 15, 2022, 7:41pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/7 "2022-11-15T19:41:23Z")

</div>

Bryan,

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

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 15, 2022, 7:44pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/8 "2022-11-15T19:44:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bdassow](https://avatars.discourse-cdn.com/v4/letter/b/8e7dd6/32.png) [@bdassow](https://developer.squareup.com/forums/u/bdassow)\
**Post date:** [February 4, 2023, 4:45pm UTC](https://developer.squareup.com/forums/t/unexpected-token-is-not-valid-json/7557/9 "2023-02-04T16:45:31Z")

</div>

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