When utilizing Customer-Present Cloud only one transaction maybe completed at a time per device. This means that if Device A is currently in the middle of a transaction, an additional transaction can not be started for Device A, as Cloud devices can only accept one transaction at a time. Due to this concept if for any reason you need or wish to reset the POI Device before a transaction has been processed, but after the transaction has began, you may perform a cancellation request via the API.
However, this does NOT guarantee the transaction can be cancelled on the device. If the authorization has already begun, you will need to void the transaction after it has completed, assuming it was approved.
This request will terminate any on-going transactions with Customer-Present Cloud. The use case for this may vary depending if you hope to simply just cancel the request prior to completion or an error occurred and left the previous transaction stuck.
Here is an example of an error which may cause a transaction to be stuck and would require the cancellation request to be used:
- A transaction was started on the cloud device.
- The customer closed their "application" prior to transaction returning a response.
- The customer re-opened the "application"
- The customer tried starting a new transaction, while the first one (from step 1) is still running
- Error would be returned showing that the "device is currently in use".
The above example would lead to this error occurring. To correct this issue you will need to either await for the transaction to be completed or you may terminate the transaction and reattempt it.
Terminate Cloud Transaction
Should your integration need to cancel a transaction while it is in progress, you may submit an additional request to terminate the in progress transaction. To complete this you will need to submit a request utilizing the
poi_device_id and the parameter
poi_request with a value of cancellation.
Here is an example, which should be posted to the API endpoint:
PARAMS: [ security_key : your_security_key poi_device_id : "POI Device Id Here" poi_request : cancellation ]
The above request will terminate any in progress transactions. Once the above request has been submitted and completed successfully you will receive an API response stating the transaction has been cancelled. Here is an example of the response you should expect:
response=1 &responsetext=Transaction cancellation requested. If the transaction cannot be
cancelled, you must process a void request once the transaction is complete.