Follow

GET /smartterminals/requests/{requestPaymentId}

BETA:
The following API is still in beta. PayJunction is actively seeking integration partners who need this API to support native applications. If you would like to participate please open a developer support ticket.

This query provides the status of a Smart Terminal payment request returned by POST /smartterminals/{smartterminalId}/request-payment

Query Limits

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

To discourage busy polling, requests to this endpoint are limited to 1 request every 2 seconds per requestPaymentId. 

Status List

Currently there is no status for when a customer cancels the transaction from the Smart Terminal itself; we are in the process of removing the ability for the customer to cancel. 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. We recommend code that passively ignores unrecognized statuses to accommodate application updates.

CONNECTING

A connection to the Smart Terminal is pending.

NO_CONNECTION

A connection failed between the webservice and Smart Terminal. 

IN_PROGRESS

The Smart Terminal is attempting to process the transaction.

BUSY

The request cannot be processed because the Smart Terminal is busy.  interruptBusyTerminal=true will circumvent this.

IMPORTANT NOTE: 
Prior to June 5, 2018, the default value of interruptBusyTerminal is true if not provided in the request.

After June 5, 2018, all requests will be treated as false and the parameter will be removed.

This change supports the migration to busy state.

COMPLETE

The transaction is completed, including signature capture, but receipt options might still be displayed or the customer might still be entering an email address.

Parameters

required name Default Value Possible Values
  interruptBusyTerminal true true / false

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 is not complete.

{
    "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."
    }]
}