SAF EDIT
SAF EDIT command is used to edit the SAF records in the SAF database. There are two scenarios to edit the SAF records:
- It is used to change the SAF status of PREAUTH, DECLINED and NOT_PROCESSED records to ELIGIBLE status.
- It is used to update the transaction amount for Pre-auth transaction(s).
Application would not modify a SAF record which is in PROCESSED/ DEFERRED status.
POS would send SAF EDIT request with the SAF number (SAF_NUM) for single transaction record or the range of SAF records (using SAF_NUM_BEGIN and SAF_NUM_END) to be updated with SET_SAF_STATUS set to ELIGIBLE. In case of a PREAUTH record, SET_TRANS_AMOUNT field can be included to update the transaction amount of the record. Once the connection to the host is restored, the application will post the updated SAF record to the gateway. While updating a range of SAF records, if only few records in the range are editable, then the POS returns the response as “X SAF RECORD(S) UPDATED” (X means the number of SAF record). Refer to Editing Multiple Transactions sample for more details on response.
- SAF transactions with DECLINED and NOT_PROCESSED status can be edited to ELIGIBLE, if the number of retries do not exceed the value set in MAXSAFRETRY parameter (default: 3 times).
- Marking a SAF Record as ELIGIBLE is not a confirmation to the user that the transaction will be processed successfully. It is completely dependent on the Gateway or the End Processor to decide over the final result of the transaction. It is recommended to perform a SAF QUERY to identify the latest status of the SAF records.
Note
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 | EDIT | Command name | ||
SAF_NUM | Character | Numeric | 1 | 4 | SAF record number. This is used to specify single transaction record only. This is required, if SAF_NUM_BEGIN and END are not specified. Example: 1235 | |
SET_SAF_STATUS | Optional | Static value | Valid value: ELIGIBLE - Queued / waiting to be processed. | This field is sent to set SAF transaction(s) status as ELIGIBLE. SAF transactions with DECLINED and NOT_PROCESSED status from the SAF database, can be edited to ELIGIBLE, if the number of retries do not exceed the value set in MAXSAFRETRY parameter (default: 3 times). | ||
SET_TRANS_AMOUNT | Optional | Floating point numnber | 1(2) | 5(2) | This transaction amount is sent, in case of single SAF record. This field will be honoured only while updating the Pre-Auth Transaction. For other transactions, SCA will not update this amount. Example: 5.00 | |
SAF_NUM_BEGIN | Optional | Numeric | 1 | 4 | Used together with SAF_NUM_END to specify range of SAF records. SAF_NUM range >1 record is only applicable to status change. Example: 1236 | |
SAF_NUM_END | Optional | Numeric | 1 | 4 | Used together with SAF_NUM_BEGIN to specify range of SAF records. If not specified, edits from SAF_NUM_BEGIN to end of records (3.1.67 and higher) SAF_NUM range >1 record is only applicable to status change. Example: 1237 | |
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
Following is an example of request packet
<TRANSACTION>
<FUNCTION_TYPE>SAF</FUNCTION_TYPE>
<COMMAND>EDIT</COMMAND>
<SAF_NUM>0001</SAF_NUM>
<SET_SAF_STATUS>ELIGIBLE</SET_SAF_STATUS>
<SET_TRANS_AMOUNT>5.00</SET_TRANS_AMOUNT>
<COUNTER>1</COUNTER>
<MAC> … </MAC>
<MAC_LABEL>REG2</MAC_LABEL>
</TRANSACTION>
Response Packet
Field | Type | Value | Description |
---|---|---|---|
RESPONSE_TEXT | Character | Processor response text. Example: SUCCESS | |
RESULT | Character | This indicates the Result details. Example: OK | |
RESULT_CODE | Numeric | Expected result code: -1, 59053, 59046, 59047, 59048, 59040 | This indicates the result code. Refer to Result/Error Codes for more details. |
TERMINATION_STATUS | Character | 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. |
COUNTER | Numeric | Echoes COUNTER sent in the request. Example: 100 |
Example
Example Request | Example Response |
---|---|
|
|
If the transaction is already processed or Maximum number of EDIT exceeded:
Example Request | Example Response |
---|---|
|
|
When a Transaction with particular SAF_NUM is not present in device:
Example Request | Example Response |
---|---|
|
|
Editing Multiple transactions using SAF Edit:
Example Request | Example Response |
---|---|
|
|