Steps for Web-Redirect

StartSession

A StartSession initiates a session to set up a web-redirect payment transaction.

Requests

The StartSession API Reference outlines the required and optional parameters needed for your request. The minimum required information in your request includes the merchants Terminal ID ( TERMID) and Password (PASS), the type of transaction (W for Web-Redirect), the action (STARTSESSION), the Amount (AMT ) of the transaction, the Customer Name (CUSTNAME) and Customer Email Address (CUSTEMAIL), and a unique Request ID (REQUESTID).

To add additional details to the transaction, you may include parameters such as LANG , REFNUM, INV, and DESC.

You may also utilize our optional functionalities such as USERFEE, PLATFEE, and PLATCHRG.

If you need to dynamically set the Return URLs on a per-session basis, you can include the SUCCESSURL and FAILUREURL parameters to control where the customer is redirected after payment - for example, back to the registration page.

Refer to StartSession API Reference

# Example StartSession request
curl --request POST \
  --url https://svra.interpaypos.com:1443/ \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{
    "TYPE": "W",
    "ACTION": "StartSession",
    "TERMID": "TEST0058",
    "PASS": "zX3Ht5va",
    "AMT": "200.00",
    "CUSTNAME": "John Doe",
    "CUSTEMAIL": "[email protected]",
    "REQUESTID": "123456789"
  }'

Response

All requests will be responded to with TEXT field and CODE field, and if successful, a SECUREID and URL field.

  • TEXT : "SUCCESS", or the description of the error.
  • CODE: "0000" constitutes a successful transaction, and any other 4-digit code constitutes a failure. Refer to Errors & Troubleshooting.
  • SECUREID: A unique identifier for the session.
  • URL: URL to redirect the customer's browser to for completing the transaction.

Additional fields returned include HOST, USERFEE, DATE, TIME, and DUR.

Example Response:

{
  "TEXT": "SUCCESS",
  "CODE": "0000",
  "SECUREID": "43z9e7jte5tqo1u1pvyi",
  "URL": "https://testgate.interpaypos.com/api/HOSTPYMT/pay/?SecureID=43z9e7jte5tqo1u1pvyi",
  "HOST": "https://testgate.interpaypos.com"
  "USERFEE": "1.04", //Will provide the USERFEE if the merchant's profile is setup for CustomerPay
  "DATE": "2024-10-14",
  "TIME": "10:00:00"
  "DUR": "0.132"
}
ℹ️

Redirect in between StartSession and Get Result

In between Step 1 and Step 2 is where the cardholder is redirected to the URL provided in Step 1's response. They are redirected to SportsPay's hosted payment page where they will enter their credit card information and complete the payment. Step 2 commences once the cardholder has completed the transaction (whether that's an approval or decline).


Step 2: Get Result

GetResult retrieves the result of the transaction after the customer has completed their actions on the hosted payment page.

⚠️

Important

Do not send a GetResult message until after the user has been redirected back to your Return URL. If a GetResult is received prior to the browser returning to your system then the transaction may be cancelled automatically.

Requests

The GetResult API Reference outlines the required and optional parameters needed for your request. The minimum required information in your request includes the merchants Terminal ID ( TERMID) and Password (PASS), the type of transaction (W for Web-Redirect), the action (GETRESULT), and the Secure ID (SECUREID) that was returned in StartSession.

You may also choose to capture the payment in this Step by passing the ACK field which would complete the entire payment. If you pass ACK=N (Ack = No), then you must complete Step 3: Acknowledge to complete the payment.

Refer to Get Result API Reference

Request Format

Required Fields:

  • TERMID: Terminal ID of the merchant. This should be 8 alphanumeric characters, e.g., TEST0058.
  • PASS: Password for the Terminal ID, e.g., zX3Ht5va.
  • TYPE: Transaction type. Will be W for Web-Redirect.
  • ACTION: Will be GETRESULT.
  • SECUREID: The session identifier returned by the Start Session step.
# Example GetResult request with no Ack
curl --request POST \
  --url https://svra.interpaypos.com:1443/ \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{
    "TYPE": "W",
    "ACTION": "GetResult",
    "TERMID": "TEST0058",
    "PASS": "myPassword123",
    "SECUREID": "q1qnteiif95i5xo45x6",
    "ACK": "N"
  }'

Response

All requests will be responded to with TEXT field and CODE field, and if successful, other fields that include:

  • TEXT : "APPROVED", or the description of the error.
  • CODE: "0000" constitutes a successful transaction, and any other 4-digit code constitutes a failure. Refer to Errors & Troubleshooting.
  • SECUREID: A unique identifier for the session.
  • CARDTYPE: One letter abbreviation to signify the card type that was used.
  • AMT: Amount that was approved, not including the USERFEE if there was a USERFEE. (The USERFEE amount is passed back in its own field).
  • REFNUM: Reference number for the transaction that is provided by the gateway.
  • ACK: Whether the ACK was completed by your server in the GetResult call.

All approved transactions will include Tokenized Card Data (TOKEN). Additional fields returned include AUTH, USERFEE, GATEREF, DATE, TIME, and DUR.

Example Response:

{
  "CODE": "0000",
  "TEXT": "APPROVED",
  "SECUREID":"q1qnteiif95i5xo45x63"
  "CARDTYPE: "V"
  "AMT": "200.00" //AMT NOT INCLUDING THE USERFEE
  "USERFEE": "1.04"
  "REQUESTID": "1234156789"
  "REFNUM": "REF123456" //Generated by gateway
  "AUTH": "T11520"
  "TOKEN":"4724RVDJCRV77328"
  "GATEREF": "AJDFJKHKSD212134SDF"
  "ACK":"N" //Whether Ack was also completed by your server
  "DATE": "2024-10-15",
  "TIME": "11:17:10"
  "DUR": "0.144"
}
⚠️

Always check that the GetResult returns ACK=Y if you are passing it in the call. If it is not returned, you will need to send the ACK call (see Step 3) or else the transaction will be reversed.


Step 3: Acknowledge (Ack)

Sends an acknowledgment to the gateway after the transaction result is obtained. If no Ack message is received (whether that's in the GetResult call or Ack call within 3 minutes of the transaction being approved, then the transaction will be reversed.

Request Format

The Ack API Reference outlines the required and optional parameters needed for your request. The minimum required information in your request includes the merchants Terminal ID ( TERMID) and Password (PASS), the type of transaction (W for Web-Redirect), the action (ACK), and either the Secure ID (SECUREID) that was returned in StartSession or the Reference Number (REFNUM) that was returned in GetResult, and an acknowledgement (ACK=Y).

Refer to Ack API Reference

# Example Ack request
curl --request POST \
  --url https://svra.interpaypos.com:1443/ \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{
    "TYPE": "W",
    "ACTION": "Ack",
    "SECUREID": "q1qnteiif95i5xo45x63",
    "TERMID": "TEST0058",
    "PASS": "zX3Ht5va"
  }'

Response

All requests will be responded to with TEXT field and CODE field:

  • TEXT : "CAPTURED" if successful or "REVERSED" if unsuccessful.
  • CODE: "0000" constitutes a successful transaction, and any other 4-digit code constitutes a failure. Refer to Errors & Troubleshooting.

Additional fields returned include DATE, TIME, and DUR.

Example Response:

{
  "CODE": "0000",
  "TEXT": "CAPTURED",
  "DATE": "2024-10-15",
  "TIME": "11:17:10",
  "DUR": "0.144"
}