SAF REMOVE
This command clears all SAF transactions from the database as specified. If a range is specified, only that range is affected.
The application has settings to purge the queue after the transactions have been processed. You do not need to initiate that process. The safpurgedays parameter controls how many days the transactions are kept before purging.
Warning
To avoid potential conflicts, never run FUNCTION_TYPE SAF transactions during an ‘open’ session between the POS and the payment device.
Note
Removal of an ELIGIBLE transaction essentially voids the offline transaction. Removal of a PROCESSED transaction simply removes the SAF record.
Device UI Required: No
Request Packet
Field | Rule | Type | Minimum | Maximum | Value(s) | Description |
---|---|---|---|---|---|---|
FUNCTION_TYPE | Required | Static Value | SAF | Type of function | ||
COMMAND | Required | Static Value | REMOVE | Command name | ||
SAF_NUM_BEGIN | Optional | Numeric | 1 | 4 | SAF transaction beginning numbers. Example: 1235 | |
SAF_NUM_END | Optional | Numeric | 1 | 4 | SAF transaction ending numbers. Example: 1236 | |
POS_RECON | Optional | Character | 1 | 30 | POS reconciliation. POS Reconciliation field to be echoed back in response to POS. Example: RetailPOS1 | |
SAF_STATUS | Optional | List |
|
If specified, SAF transactions returned will be filtered by this status. | ||
COUNTER | Required | Numeric | 1 | 10 | COUNTER is used for a given MAC label. Each COUNTER should be higher than the last one. Used to authenticate the POS. Example: 100 | |
MAC | Required | Base64 Encoded Data | Message Authentication Code. Used to authenticate the POS | |||
MAC_LABEL | Required | Character | 1 | 50 | Associated label that tells the device which MAC_KEY to use to decrypt the value of MAC. Used to authenticate the POS. Example: REG1 |
Example (Clear Range)
Following is an example of request packet
<TRANSACTION>
<FUNCTION_TYPE>SAF</FUNCTION_TYPE>
<COMMAND>REMOVE</COMMAND>
<COUNTER>1</COUNTER>
<MAC> … </MAC>
<MAC_LABEL>REG2</MAC_LABEL>
<SAF_NUM_BEGIN>1235</SAF_NUM_BEGIN>
<SAF_NUM_END>1236</SAF_NUM_END>
</TRANSACTION>
Response Packet
Field | Type | Value(s) | Description |
---|---|---|---|
RESPONSE_TEXT | Character | SAF RECORD(S) REMOVED | Processor response text |
RESULT | Character | OK | This indicates the Result details. |
RESULT_CODE | Numeric | Expected result code: -1, 59046, 59047, 59048, 59043, 59040 | This indicates the result code. |
TERMINATION_STATUS | Character | Valid values: SUCCESS or FAILURE | This indicates the transaction termination status. This is the overall status of the transaction irrespective of approved or declined. Like, if the output is generated then the status is SUCCESS and if no output is generated then the status will be FAILURE. |
POS_RECON | Character | POS reconciliation field echoed back if sent in request. Example: RetailPOS1 | |
COUNTER | Numeric | Echoes counter sent in the request. Example: 100 | |
MERCHID | Numeric | Merchant ID. Example: 900000000123 | |
TERMID | Numeric | Terminal ID. Example: 001 | |
RECORD_COUNT | Numeric | Number of stored records. Example: 5 | |
TOTAL_AMOUNT | Floating point number | Total amount of all SAF records. Example: 5.00 | |
RECORDS | See RECORD section for child elements. When no records, this element will still be present. |
RECORD Child Elements
Field | Type | Value(s) | Description |
---|---|---|---|
ACCT_NUM | Numeric | Returns the masked account number. This is a conditional field. Example: 400555******0019 | |
TRANS_AMOUNT | Floating point number | Returns the transaction amount. This is a conditional field. Example: 5.00 | |
INVOICE | Character | Merchant invoice number. This is a conditional field. Example: 123456 | |
PAYMENT_TYPE | Character | Returns the type of payment used. This is a conditional field. Example: CREDIT | |
PAYMENT_MEDIA | Character | Mode of payment. This is a conditional field. Example: VISA | |
SAF_NUM | Numeric | SAF number. This is a conditional field. Example: 0045 | |
SAF_STATUS | Character | SAF transaction status. This is a conditional field. Example: QUEUED | |
CTROUTD | Numeric | Returns Client-specific Transaction routing ID. This is a conditional field. Example: 124 | |
AUTH_CODE | Character | Authorization code. This is a conditional field. Example: 17760K | |
CARD_TOKEN | Character | Card Token. This is a conditional field. Example: 8834134431340010|0AB5DD | |
TOKEN_SOURCE | Character | Source of token. This is a conditional field. Example: PWC | |
BANK_USERDATA | Character | Bank User Data, normally returned with CARD_TOKEN. Maximum 50 alphanumeric characters. This is a conditional field. Example: /CustData`JANE`K`DOE`````00` | |
CVV2_CODE | Character | Result of CVV2 check. This is a conditional field. Example: M |
Transaction Performance Metric
Note
These fields are returned, if SCAPERFMETRIC parameter (Application Parameters) is enabled.
Field | Type | Value | Description |
---|---|---|---|
UI_TIME | Time | This indicates the time duration, for which the device screen is displayed (like error message, prompt screen, remove card screen) till any user action is performed in the command execution flow. This field is not applicable to capture the time for the Processing, Authorizing and transaction status screen. The format of the returned value would be S.sss, where S is seconds (this can be 0 to any positive integer) and sss is milliseconds. In case of any insignificant time or 0.000 value, will not be returned in the response. Example: <UI_TIME>44.028</UI_TIME> |
|
HOST_TIME | Time | This indicates the time taken for the Connection to the host, sending request and receives data from the host. This field also take the cumulative time for multiple requests which may sent to the host during the transaction including two legged transactions, timeout requests, Auto Last Tran requests, DCC, Credit app proxy. The format of the returned value would be S.sss, where S is seconds (this can be 0 to any positive integer) and sss is milliseconds. In case of any insignificant time or 0.000 value, will not be returned in the response. Example: <HOST_TIME>1.389</HOST_TIME> |
|
CMD_TIME | Time | This field indicates the total amount of time for a command, which is executed by the application from request received to the response sent. The format of the returned value would be S.sss, where S is seconds (this can be 0 to any positive integer) and sss is milliseconds. In case of any insignificant time or 0.000 value, will not be returned in the response. Example: <CMD_TIME>70.765</CMD_TIME> |
Example 1
Following is an example when there are SAF records to be removed
<RESPONSE>
<RESPONSE_TEXT>2 SAF RECORDS REMOVED</RESPONSE_TEXT>
<RESULT>OK</RESULT>
<RESULT_CODE>-1</RESULT_CODE>
<TERMINATION_STATUS>SUCCESS</TERMINATION_STATUS>
<COUNTER>1</COUNTER>
<RECORD_COUNT>2</RECORD_COUNT>
<TOTAL_AMOUNT>10.40</TOTAL_AMOUNT>
<RECORDS>
<RECORD>
<RECORD>
<ACCT_NUM>523456******1594</ACCT_NUM>
<TRANS_AMOUNT>5.20</TRANS_AMOUNT>
<INVOICE>123456</INVOICE>
<PAYMENT_TYPE>CREDIT</PAYMENT_TYPE>
<PAYMENT_MEDIA>MASTERCARD</PAYMENT_MEDIA>
<SAF_STATUS>QUEUED</SAF_STATUS>
<SAF_NUM>1235</SAF_NUM>
<CTROUTD>124</CTROUTD>
<AUTH_CODE>17760K</AUTH_CODE>
<CARD_TOKEN>8834134431340010|0AB5DD</CARD_TOKEN>
<CVV2_CODE>M</CVV2_CODE>
<BANK_USERDATA>/CustData`JANE`K`DOE`````00`</BANK_USERDATA>
</RECORD>
<RECORD>
<ACCT_NUM>400555******0019</ACCT_NUM>
<TRANS_AMOUNT>5.20</TRANS_AMOUNT>
<INVOICE>123456</INVOICE>
<PAYMENT_TYPE>CREDIT</PAYMENT_TYPE>
<PAYMENT_MEDIA>VISA</PAYMENT_MEDIA>
<SAF_STATUS>QUEUED</SAF_STATUS>
<SAF_NUM>1236</SAF_NUM>
<CTROUTD>123</CTROUTD>
<AUTH_CODE>17760K</AUTH_CODE>
<CARD_TOKEN>8834134431340010|0AB5DD</CARD_TOKEN>
<CVV2_CODE>M</CVV2_CODE>
<BANK_USERDATA>/CustData`JANE`K`DOE`````00`</BANK_USERDATA>
</RECORD>
</RECORDS>
</RESPONSE>
Example 2
Following is an example when there are SAF records are not present
<RESPONSE>
<RESPONSE_TEXT>NO SAF RECORDS REMOVED</RESPONSE_TEXT>
<RESULT>OK</RESULT>
<RESULT_CODE>-1</RESULT_CODE>
<TERMINATION_STATUS>SUCCESS</TERMINATION_STATUS>
<COUNTER>1</COUNTER>
<RECORD_COUNT>0</RECORD_COUNT>
<RECORDS />
</RESPONSE>