Upfront Payment Widget
Learn how to use our upfront payment widget as part of your spend journey.
During your spend journey, you may wish for a customer to complete an upfront payment in order to complete their purchase.
This upfront payment amount will be a one off payment as part of the purchase with the remaining purchase balance being applied to the selected finance offering.
Embed the Upfront Payment Widget
As part of the spend journey you will call the authorisation endpoint to make the purchase. If an upfront payment is required, the response will look as below.
You can then use the redirect href to load the upfront payment widget to allow the customer to continue the spend journey.
You should also add a redirect_uri
to the query string of the redirect href.
Get control back from the Upfront Payment Widget
The Upfront Payment Widget will try and collect a card payment from the customer.
On completion of this or if any unrecoverable error has occured, the widget will post serialized data back to the redirect_uri
provided in the query string.
The data returned by the widget must be deserialized before usage.
You must provide NewDay with a list of URLs where you intend to embed the widget, as well as the redirect URIs you will wish to use for redirect purposes. These will be added in our CORS policy whitelist.
Expected POST request payloads
The payload will have different formats based on the outcome of upfront payment.
The expected formats are:
Success
You should then call the authorisation endpoint again, adding the payment token and the payment session id to the request.
Errors
Recoverable errors that allow the user to try again or to provide a different card number will be handled by the spend widget.
Any error returned by the Upfront Payment widget is unrecoverable and should terminate the whole spend flow.
You may also like:
Still have questions
Can’t find the answer to your question? Our friendly team are more than happy to help
Was this page helpful?