# Integrating square payment form in NextJS. Type Error: window.Square.payments is not a function

**URL:** <https://developer.squareup.com/forums/t/integrating-square-payment-form-in-nextjs-type-error-window-square-payments-is-not-a-function/4888>\
**Category:** Questions\
**Tags:** payment-form\
**Created:** [January 22, 2022, 12:40pm UTC](https://developer.squareup.com/forums/t/integrating-square-payment-form-in-nextjs-type-error-window-square-payments-is-not-a-function/4888 "2022-01-22T12:40:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![woyin](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@woyin](https://developer.squareup.com/forums/u/woyin)\
**Post date:** [January 22, 2022, 12:40pm UTC](https://developer.squareup.com/forums/t/integrating-square-payment-form-in-nextjs-type-error-window-square-payments-is-not-a-function/4888/1 "2022-01-22T12:40:08Z")

</div>

Hi there, I am currently creating an e-commerce website and trying to integrate the Square payment form. I am currently following the documentation @[https://developer.squareup.com/docs/web-payments/take-card-payment](https://developer.squareup.com/docs/web-payments/take-card-payment) and have added the square cdn “[https://sandbox.web.squarecdn.com/v1/square.js](https://sandbox.web.squarecdn.com/v1/square.js)” in a script tag in the head of the html document. When initializing the form as shown in the documentation I get the below error

Type Error: window.Square.payments is not a function

Please find a screenshot of my code below.

 ![Screenshot 2022-01-22 at 12.31.12](https://global.discourse-cdn.com/square/original/1X/94fdf5bb0fc76bbc5d98fdbdd9eecb67c6a01c17.png)

is there something i am doing wrong? Any assistance will be much appreciated.

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [January 24, 2022, 8:59pm UTC](https://developer.squareup.com/forums/t/integrating-square-payment-form-in-nextjs-type-error-window-square-payments-is-not-a-function/4888/2 "2022-01-24T20:59:43Z")

</div>

Hey there @woyin, welcome to the forums! 👋

If you’re following along with the Web Payments Quick Start, can you verify if you have all the [dependencies installed](https://github.com/square/web-payments-quickstart#getting-started)?

---

<div class="post-metadata">

**Author:** ![woyin](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@woyin](https://developer.squareup.com/forums/u/woyin)\
**Post date:** [January 24, 2022, 9:39pm UTC](https://developer.squareup.com/forums/t/integrating-square-payment-form-in-nextjs-type-error-window-square-payments-is-not-a-function/4888/3 "2022-01-24T21:39:45Z")

</div>

Hi Josh,

Thank for the quick response. Yes, I can confirm that all my dependencies have been installed. My current Node version is v14.18.0

 ![Screenshot 2022-01-24 at 21.37.06](https://global.discourse-cdn.com/square/original/1X/bf9705994376a6d8b69a1c50a00731fbfa2a0cef.png)  
 ![Screenshot 2022-01-24 at 21.37.24](https://global.discourse-cdn.com/square/original/1X/154e2655d08b7b3d120cdb5a32a9c1b456ee8024.png)

Please let me know if I am missing any dependencies.

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [January 25, 2022, 7:45pm UTC](https://developer.squareup.com/forums/t/integrating-square-payment-form-in-nextjs-type-error-window-square-payments-is-not-a-function/4888/4 "2022-01-25T19:45:40Z")

</div>

I see that you do have the `square` package, but I’m not seeing the rest of the packages from the quickstart project’s dependencies. For reference, here’s the quickstart’s [package.json](https://github.com/square/web-payments-quickstart/blob/main/package.json).
