Demo app
A small store that takes PayTomorrow financing end to end. Download it, run it against staging, and copy what you need.
The demo app is a working store built on the PayTomorrow API. It shows the whole integration in one place: checkout with the real application in an iframe, postbacks, status checks, and settling, cancelling, and refunding orders. Every step appears on the order page with the file that did it, so you can follow along in the code.
Download the demo app (.zip)Run it
unzip paytomorrow-demo.zip && cd paytomorrow-demo
npm install
npm startOpen http://localhost:4000 and enter your staging credentials from Resources in the staging merchant dashboard. It needs Node 22 or newer. Nothing is saved to disk.
The checkout form is filled with a new made-up customer on every visit, because staging declines reused phone numbers, emails, and SSNs. See Testing.
Postbacks on localhost
PayTomorrow can't reach localhost. Add a free ngrok authtoken on the setup page and the app opens a tunnel to its postback port only. Without one, orders still update when the customer comes back from the application and on a one-minute sweep.
What to read
| File | What it does |
|---|---|
src/flows/checkout.ts | Creates the order and the PayTomorrow application |
public/iframe-checkout.js | Handles the iframe's messages |
src/flows/receive-postback.ts | Saves a postback and queues a status check |
src/flows/reconcile.ts | Reads the real status, validates, and moves the order |
src/flows/order-actions.ts | Settle, cancel, and refund, each exactly once |
The app follows the rules in Postbacks: postbacks are treated as hints, the status always comes from Get application status, and orders only move forward.