1. Authenticate, Create Application and Display Contract
The Full API integration differs from the conventional API integration in the amount of data you gather at start.
- Authenticate with your PayTomorrow credentials to get an access token.
- Create an application with the Create Application API call to get a list of PayTomorrow offers you can display on your site to the customer.
- Display Contract each PayTomorrow offer comes with a link to it's contract and payment form. You can either redirect to the contract or display the contract in an iframe.
2. Redirect or Iframe
Once you have the offer list and your customer has selected an offer you have two options.
- Redirect to the contract url and allow PayTomorrow to redirect back to your site once the consumer completes the application.
- Open an Iframe with the contract 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: https://bitbucket.org/paytomorrow/pt-iframe-demo/src/master/
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.