Step 4: Deploy a server backend
cURL commands are useful for testing, but impractical for production. Use our sample server to process a production Charge request.
The sample server for In-App Payments is an example server that exposes 1 endpoint for charging a card for a cookie. The charge appears as a credit on your Square account.
- Click this link to open the Heroku sign up page: Deploy to Heroku
- Login or create a Heroku account.
- Enter a unique Heroku app name.
- Go to the Square Application Dashboard and select your application.
- Copy the Personal Access Token from the Credentials tab into the
ACCESS_TOKENfield of the Heroku configuration page.
- Click Deploy app on the Heroku configuration page.
[Heroku app name].herokuapp.com/chargeForCookieas your URL.