Skip to main content

SCA Functional Specification

SAF EDIT

Last updated: 04-Dec-2024

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.

  

Note

  • 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.

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
<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>
<RESPONSE_TEXT> 1 SAF RECORD(S)UPDATED<RESPONSE_TEXT>
<RESULT>OK</RESULT>
<RESULT_CODE>-1</RESULT_CODE>
<TERMINATION_STATUS>SUCCESS</TERMINATION_STATUS>
<COUNTER>1</COUNTER>
<RESPONSE>

If the transaction is already processed or Maximum number of EDIT exceeded:

Example Request Example Response
<TRANSACTION>
<FUNCTION_TYPE>SAF</FUNCTION_TYPE>
<COMMAND>EDIT</COMMAND>
<SAF_NUM>0017</SAF_NUM>
<SET_SAF_STATUS>ELIGIBLE</SET_SAF_STATUS>
<MAC_LABEL>P_UWSQPX</MAC_LABEL>
<COUNTER>58</COUNTER>
<MAC>I1XaWqAELXO5Wbi2CZ/dXxcAX4h04u3WiT8jwme88Gg=</MAC>
</TRANSACTION>
<RESPONSE>
<RESPONSE_TEXT>SAF EDIT NOTALLOWED</RESPONSE_TEXT>
<RESULT>ERROR</RESULT>
<RESULT_CODE>59053</RESULT_CODE>
<TERMINATION_STATUS>FAILURE</TERMINATION_STATUS>
<COUNTER>58</COUNTER>
</RESPONSE>

When a Transaction with particular SAF_NUM is not present in device:

Example Request Example Response
<TRANSACTION>
<FUNCTION_TYPE>SAF</FUNCTION_TYPE>
<COMMAND>EDIT</COMMAND>
<SAF_NUM>0019</SAF_NUM>
<SET_SAF_STATUS>ELIGIBLE</SET_SAF_STATUS>
<MAC_LABEL>P_UWSQPX</MAC_LABEL>
<COUNTER>59</COUNTER> <MAC>VfJk40oDKtPJdxkEpXVYMl3a3DR1m7f64maNT6MLJlk=</MAC>
</TRANSACTION>
<RESPONSE>
<RESPONSE_TEXT>NO SAF RECORDS FOUND</RESPONSE_TEXT>
<RESULT>ERROR</RESULT>
<RESULT_CODE>59053</RESULT_CODE>
<TERMINATION_STATUS>FAILURE</TERMINATION_STATUS>
<COUNTER>59</COUNTER>
</RESPONSE>

Editing Multiple transactions using SAF Edit:

Example Request Example Response
<TRANSACTION>
<FUNCTION_TYPE>SAF</FUNCTION_TYPE>
<COMMAND>EDIT</COMMAND>
<SET_SAF_STATUS>ELIGIBLE</SET_SAF_STATUS>
<SAF_NUM_BEGIN>25</SAF_NUM_BEGIN>
<SAF_NUM_END>29</SAF_NUM_END>
<MAC_LABEL>P_0HNIMC</MAC_LABEL>
<COUNTER>46</COUNTER>
<MAC>hymEGwd4lkxfRzrsGv0316lAKsn/qhvzEO//Rsuqhus=</MAC>
</TRANSACTION>
<RESPONSE>
<RESPONSE_TEXT>2 SAFRECORD(S)UPDATED</RESPONSE_TEXT>
<RESULT>OK</RESULT>
<RESULT_CODE>-1</RESULT_CODE>
<TERMINATION_STATUS>SUCCESS</TERMINATION_STATUS>
<COUNTER>46</COUNTER>
</RESPONSE>

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo