Skip to main content

SCA Functional Specification

SAF REMOVE

Last updated: 04-Dec-2024

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    
Valid values:
  • ELIGIBLE - Queued / waiting to be processed.
  • IN_PROCESS - In process.
  • NOT_PROCESSED - When a Deferred SAF transaction is retried for configured number of times and if it fails for all retries, then the status of the record will be updated to NOT_PROCESSED.
  • PREAUTH - AUTH transaction.
  • PROCESSED - Approved, including duplicate.
  • DECLINED - Declined transaction.
  • DEFERRED - Transactions getting unknown result response.
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 Comments
RESPONSE_TEXT A SAF RECORD(S) REMOVED  
RESULT C OK or Error Code Refer to <Error Section>
RESULT_CODE N -1
59046
59047
59048
59043
 
TERMINATION_STATUS C SUCCESS or
Error Codes
 
MERCHID N Ex: 900000000123 Merchant ID
TERMID N Ex: 001 Value to be stored by POS
COUNTER N Echoes COUNTER sent
in the request
Sent in response for POS to validate for REV_VER=2.
Appears as Base64 encoded.
RECORD_COUNT N Ex: 5 Number of stored records
TOTAL_AMOUNT F Ex: 5.0 Total amount of all SAF records
RECORDS     See RECORD(s) section for child elements
Record(s)
ACCT_NUM | N | Ex: 400555******0019 | Conditional
TRANS_AMOUNT F Ex: 5.0 Conditional
INVOICE C Ex: 123456 Conditional
PAYMENT_TYPE C Ex: CREDIT Conditional
PAYMENT_MEDIA C Ex: VISA Conditional
SAF_NUM N Ex: 0045 Conditional
SAF_STATUS C Ex: QUEUED Conditional
CTROUTD N Ex: 45 CTROUTD is a sequence number for PAYMENT transactions
(always enabled) that is generated per Client ID.
Each Client ID has its own CTROUTD sequence counter.
This is a conditional field.
TROUTD N Ex: 435674 Conditional
CARD_TOKEN C Ex: 7987654321098765 Conditional
TOKEN_SOURCE C Ex: PWC Conditional
AUTH_CODE C Ex: TA1561 Conditional
BANK_USERDATA C /CustData`JANE`K`DOE`````00` Conditional
CVV2_CODE C Ex: M Conditional - applicable to direct-to-processor
(DHI) implementations only
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>

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