We are using TriPOS and we are looking for a way to learn the state of the PinPad while we process a payment. By state we mean "waiting for card","waiting for pin", "processing" etc.
Is there a way we can achieve this?
Thanks in advance.
Thalia
We are using TriPOS and we are looking for a way to learn the state of the PinPad while we process a payment. By state we mean "waiting for card","waiting for pin", "processing" etc.
Is there a way we can achieve this?
Thanks in advance.
Thalia
This is a bit of a code dump, but this is how we check the lane status...
code behind
[WebMethod]
public static async Task<string> GetDeviceStatus()
{
try
{
string url = "http://localhost:8080/api/v1/status/lane/" + ConfigurationManager.AppSettings["triPosLaneId"].ToString();
var message = new HttpRequestMessage(HttpMethod.Get, new Uri(url));
message = tpds.CreateHttpRequest(message);
using (var httpResponse = await client.SendAsync(message).ConfigureAwait(false))
{
return await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
}
}
catch (Exception ex)
{
UtilityService.LogErrors("Exception occurred: " + ex.Message);
UtilityService.LogErrors("Stack trace:\n" + ex.StackTrace);
return string.Empty;
}
}
aspx page
interval = setInterval(getDeviceStatus, 250)
const getDeviceStatus = async () => {
try {
let resp = await fetch('<%= ResolveUrl("Payment.aspx/GetDeviceStatus") %>', getOptions({}))
let json = await resp.json()
let status = JSON.parse(json.d.Result)
//console.log(status.laneStatus)
if (triPosComplete === false && status.laneStatus === 'NotInUse') {
hideSpinner()
} else if (triPosComplete === false && status.laneStatus === 'Host') {
showSpinner()
}
} catch (error) {
window.location.href = `PaymentError?error=AJAX error (getDeviceStatus): ${error}`
}
}
The provided code is for TriPOS direct or we can make it work for TriPOS Cloud as well?
Because we are using TriPos Cloud and I tried the endpoint '/api/v1/status/lane/' but the response was that it's not supported in TriPOS Cloud.
I don't know a lot about triPOS Cloud but I think it might be this for lane management:
https://triposcert.vantiv.com/cloudapi/v1/lanes/{laneId}/connectionstatus
The Lane Status Details endpoint is only supported with triPOS Direct at this time.