Skip to content
Last updated

Manual settlement

The Tyro terminal processes transactions as part of a settlement period — a business day. Funds land in the settlement account once that period is closed on the terminal. Terminals are scheduled to close their settlement period automatically once every 24 hours (by default, at midnight or 5 AM AEST), and that automatic settlement time can be changed on the terminal if needed. Manual settlement lets the POS send the settlement request to the terminal itself instead — typically as part of the POS's own end-of-day process — and the terminal closes off the current settlement period there and then.

Before you begin, check the certification criteria: Certification Criteria Document.

Making the request

Function definitionPurposeParameters
manualSettlement(responseReceivedCallback, options)Initiates a manual settlement request on the terminal.responseReceivedCallback (Function); options (Object)
ParameterTypeDescriptionRequired
midIntegerOverride the configured mid for multi-merchant terminals, or if your browser does not support local storage, or if you have developed headless pairing as a feature.Optional — required for headless pairing, multi-merchant, or if your browser does not support local storage
tidIntegerOverride the configured tid for multi-merchant terminals or if your browser does not support local storage or if you have implemented headless pairing as a feature.Optional — required for headless pairing, multi-merchant, or if your browser does not support local storage
integrationKeyStringSupply the integration key if your browser does not support local storage or if you have developed headless pairing or multi-merchant as a feature.Optional — required for headless pairing, multi-merchant, or if your browser does not support local storage
function doManualSettlement() {
reset();
iclient.manualSettlement(responseReceivedCallback);
}

var responseReceivedCallback = function(response) {
console.log(JSON.stringify(response));
$("#result").html(response.result);
$("#Message").html(response.message);
$("#TerminalBusinessDay").html(response.currentTerminalBusinessDay);
}

JS Fiddle demo

Don't click Save if you make changes in the JS Fiddle — click Run instead. Clicking Save may break the fiddle's functionality.

Handling the response

The manual settlement response is returned to the POS using responseReceivedCallback. The result field is either success or failure; message is text to display to the user; currentTerminalBusinessDay gives the reporting day after the settlement request, in format dd/MM/yyyy, and is only returned if result is success.

{
"result":"success",
"message":"Settlement complete",
"currentTerminalBusinessDay":"19/01/2024"
}
FunctionDescriptionUsage required
responseReceivedCallbackInvoked when the request has been completed on the terminal. Called with a single object containing the fields in the table below ? Was just a bit confusing because they're in separate tables.Required
FieldTypeDescriptionUsage required
resultStringThe result of the request, either success or failure.Required
messageStringThe message to display to the merchant.Required
currentTerminalBusinessDayStringCurrent reporting day after the settlement request. Only returned if result is success. Format dd/MM/yyyy.Required

Steps to follow

  1. Program the function that handles responseReceivedCallback and the fields it makes available.
  2. On a successful request, display a modal showing the result, the message, and the currentTerminalBusinessDay.
  3. On an unsuccessful request, display a modal showing the result and the message.
var responseReceivedCallback = function(response) {
console.log(JSON.stringify(response));
$("#result").html(response.result);
$("#Message").html(response.message);
$("#TerminalBusinessDay").html(response.currentTerminalBusinessDay);
}
Example response
{
  "result":"success",
  "message":"Settlement complete",
  "currentTerminalBusinessDay": "18/12/2021"
}