How to integrate card payments in Square, with my own ecommerce site?


Im running my own ecommerce site for my client and we want to integrate with Square for the processing of card payments. When a customer is ready to pay, I want the card entry form to be within my client’s website so that throughout the payment process, they appear still to be in the one website.

I’ve built a form using the Square Docs at “”, but it errors on part of the C&P code.

Whilst I try to resolve it, I wondered whether I should be using a different set of docs/code?


Hi @Ambrose welcome to the forums!

Based on your description, it does sound like the Square Payment Form is the right tool to be using. What sort of errors are you currently seeing?

To clarify: the payment form will generate a nonce, but in order to use the nonce you’ll need to rely on the Payments API (specifically CreatePayment endpoint) to actually charge the customer.

Hi Stephen, Thank you. You and I have got another thread going so, to avoid confusion, should we close this one?