Home

Awesome

In-App Payments Server Quickstart

This is an example server with a single endpoint of /chargeForCookie for processing payments using Square. The server expects a POST request with a payload of application/json following the format:

{
  "nonce": "INSERT_YOUR_NONCE_HERE"
}

Please replace "INSERT_YOUR_NONCE_HERE" with your own nonce that was generated from either the Square Payment Form or the In-App Payments SDK.

Instructions

Deploy to Heroku

Example curl request you can make to the server:

curl -X POST 'https://[Heroku app name].herokuapp.com/chargeForCookie' \
  -H 'Content-Type: application/json' \
  -d '{ "nonce": "INSERT_YOUR_NONCE_HERE" }'

You can find the test nonce values in the guide Sandbox Test Values.

Start localhost server