Follow

GET /smartterminals/requests/{requestPaymentId}

BETA:

The following API is still in beta. PayJunction is actively seeking integration partners whom need to use this API to support native applications. If you would like to participate please open a developer support ticket and let us know.

Gets the status of a Smart Terminal payment request by querying the requestPaymentId returned by POST /smartterminals/{smartterminalId}/request-payment

Query Limits

The status of a payment request can be queried up to 1 day after the Smart Terminal payment request has been completed. After this cut off the requestPaymentId is purged and will return a 404 Not Found when queried. 

In order to discourage busy polling, requests to this endpoint are rate limited to 1 request every 2 seconds per request

Status List

Currently there is no status for when a customer cancels the transaction from the Smart Terminal itself; this will be added in a future update. Until then, IN_PROGRESS will continue to be the status returned even if the transaction was cancelled.

More statuses will be added in the future to allow for tighter UI integrations. It is recommended to write your code to passively ignore unrecognized statuses to avoid breaking the application after updates.

CONNECTING

Returned when the connection to the hardware Smart Terminal is still pending

NO_CONNECTION

Returned when the webservice is unable to raise a response from the Smart Terminal.

IN_PROGRESS

The Smart Terminal is attempting to process the requested transaction.

COMPLETE

The transaction is completed, including signature capture, BUT receipt options might still be displayed or the customer might still be entering email information if they selected that option.

Example Request

curl -H "X-PJ-Application-Key:88888888-4444-4444-4444-cccccccccccc" \
-u "login:password" \
"http://www.payjunctionlabs.com/trinity/api/smartterminals/requests/b58cb128-2e99-4da8-b93e-711f1fc7d5db"

Example Responses

Connecting Example

Note that we do not have a transactionId yet because the payment has not completed.

{
    "status" : "CONNECTING"
}

Complete Example

{
    "status" : "COMPLETE",
    "transactionId" : 349
}

Purged or Invalid requestPaymentId Example

HTTP Response Code: 404

{
    "errors" : [{
        "message" : "404 Not Found"
    }]
}

Rate Limit Example

HTTP Response Code: 429

{
    "errors" : [{
        "message" : "Your request has been rate limited. Please wait longer between subsequent requests."
    }]
}