1. Authenticate and Create an Order
Start out your PayTomorrow integration by creating code that will allow you to create orders on the PayTomorrow platform.
- Authenticate with your PayTomorrow credentials to get an access token.
- Create an order with the Create Order API call to get a url for a PayTomorrow application.
Now you can copy the PayTomorrow application url and paste it in a new window to get an idea of what the consumer would see.
2. Redirect or Iframe
Once you have a way to get the application url you have two options.
- Redirect to the application url and allow PayTomorrow to redirect back to your site once the consumer completes the application.
- Open an Iframe with the url to keep the consumer on your site and listen to window messages to know when to hide the iframe.
Redirecting is much easier than adding the iframe, but the iframe will offer a better user experience for your consumers.
If you want to go down the iframe route, here's some example code that'll help you out:
3. Handle PayTomorrow Postbacks or Query Application Status
The final step of the PayTomorrow integration is the postback handling or querying of the Application Status Endpoint.
Postbacks will send you a notification of Application Status updates that you can handle as needed on your site. For more information, please read the API Flow section.
The Application Status Endpoint will return the current status of the customer's application.