Applies to: Web Payments SDK | Payments API
Learn how to get started with the Web Payments SDK for your application to take secure payments and deploy to production.
To accept a card payment from a buyer, you need a web client where the buyer enters payment card information and a backend that takes a payment with the card. The SDK produces a secure single-use payment token based on the card. Your web client sends the payment token to your backend where the payment is taken. In summary, a payment is taken with these steps:
- Generate a payment token - Use the Web Payments SDK client library to render a card entry form and generate a payment token that your web client sends to your backend server.
- Create a payment with the token - On your backend, use the Square Payments API to create a payment.
This quickstart guide shows you where to add HTML and JavaScript to your web client to integrate the Web Payments SDK and take a payment on your backend.
You can follow along with the quickstart sample repository to set up a web application that's integrated with the Web Payments SDK for taking payments.
Important
If you're not familiar with building an application using Square client-side SDKs, Square recommends completing this quickstart using the GitHub project before you attempt to integrate the Web Payments SDK into your application.
Use the following steps to take card payments in a web client with the Web Payments SDK:
Set Up the Web Client Application - Learn how to set up a web client application with the Web Payments SDK quickstart sample project.
Add the Web Payments SDK to the Web Client - Learn how to initialize the Web Payments SDK with the web client and a Square application to accept a card payment, generate a payment token with buyer verification, and send the resulting payment token to the server.
Verify the Payment - Learn how to view and verify the payment from the quickstart application using the Developer Console.
Deploy the Application - Learn how to deploy the application with the quickstart project by completing the required deployment tasks.