Confirmation or not of payment

Routine called by the application to close the transactional cycle. She must be activated at the moment the tax receipt is closed and receives as parameters an indicator of whether the transaction was completed or whether it should be reversed. It also receives the fields that allow identify the transaction being finalized.

This function should also be used to undo a transaction interrupted by a power outage or any other problem in the application.

This routine confirms or cancels ALL payments linked to the same Tax Coupon Number and same Tax Date passed as parameter.

void FinalizaFuncaoSiTefInterativo (Confirm, TaxCoupon, TaxDate, TaxTime, AddParam);

ASCII Interface

void FinalizaFuncaoSiTefInterativoA (Confirm, TaxCoupon, TaxDate, TaxTime, AddParam);

ParameterTypeStandard interfaceASCII interfaceDescription
ResultOutput, by valueNot usedFixed 6Contains the result of the response to the routine call.
ConfirmEntry, by valueshortFixed 1Indicates whether the transaction should be confirmed (1) or reversed (0)
TaxCouponInput, by valuechar *Max. 20Tax Coupon number corresponding to the sale
TaxDateInput, by valuechar *Fixed 8TaxDate in YYYYMMDD format
TaxTimeInput, by valuechar *Fixed 6Fiscal Time in format HHMMSS[1]
AddParamInput, by valuechar *VariableAdditional parameters, described below. If not used, automation must pass empty/NULL.

[1] The TaxTime parameter is not used as a “key” for a tax document.

Example: A sale made by the function IniciaFuncaoSiTefInterativo, passing as parameters Function 0, Value 10.00, Coupon Tax 12345, Tax Date 20150101, Tax Time 121500. When confirming the transaction, the function FinalizaFuncaoSiTefInterativo must be called using the following parameters: Confirm 1, Tax Coupon 12345, Tax Date 20150101, Tax Time 121500, AddParam as empty/NULL as there is no additional data.

The AddParam parameter can be used in the following situations:

Completion of individual payments in the same tax coupon#

For each payment, CliSiTef returns in FieldType 161 (Number of payment on the coupon) an index/counter corresponding to the payment.

To (non-)confirm a specific payment within a tax coupon, the automation must inform this value to the routine FinalizaFuncaoSiTefInterativo as an additional parameter:

{NumeroPagamentoCupom=XXX}

where XXX is the payment number, returned previously in the FieldType 161.

Completion of payments for a given network in the same tax coupon#

To (non) confirm payments relating to a certain authorizing network, you must go through the routine FinalizaFuncaoSiTefInterativo the following additional parameter:

{RedeConfirmacao=XXX}

where XXX is the authorizing network number.

Attach data relating to payment methods for a transaction (NFPAG)#

To attach data relating to payment methods for a transaction, the fields must be captured: 161 (Payment number on the coupon), 730 (Maximum number of payment methods), 731 (Types of payment enabled) and 732 (Data to be collected for the type of payment), returned in the transaction flow, and pass it to the routine FinalizaFuncaoSiTefInterativo through additional parameters Payment NumberNFPAG and NFPAG.

{NumeroPagamentoNFPAG=X}{NFPAG=Y}

Where:

X = Payment number in the coupon (Field 161)

Y = Data relating to payment methods (See description below)

Note: In this case, all payments in the same tax coupon will all be confirmed or unconfirmed.

NFPAG parameter description:

{NFPAG=FPAG1;FPAG2; FPAG3;...;FPAGn;}

Where FPAGn has the following content:


If there is data to be collected


TypeN:ValueN:CollectionIDN1:CollectionDataN1-CollectionIDN2:CollectionDataN2-...-CollectionIDNn:CollectionDataNn

If there is no data to be collected

TypeN:ValueN


=> TypeN: indicates the payment method used (Field 731, as per table below)

=> ValorN: indicates the value used with this payment method, with two decimal places, without the comma

=> IDCollectionNn: indicates the ID of the field that was collected by the POS (Field 732, as shown in the table below)

=> DataCollectionNn: indicates the content collected by the POS for this field

Note: The consistency of the values ​​(sum of the various forms of payment used, totaling the value of the transaction carried out) must be made by the POS.

Example:

At the end of a transaction worth R\$ 50.00, returning the field 730 equals 2 and the fields 731 and 732 indicating that you accept the following payment methods: Cash (no data to be collected); TEF Debit (needs to send the Destination Network, the Host NSU, the Host Date and Origin Code of the TEF) and TEF Credit transaction. O field 730 equal to 2, indicates that in the NFPAG parameter, sent a maximum of 2 payment methods.

The POS, in turn, upon confirmation of the transaction, will send the payment forms payment that were actually used: R\$ 30.00 was paid in cash and R\$ 20.00 were paid with a Redecard debit card (Rede Destination = 5; Host NSU = 123456789; Host Date = 12/15/2008; Code Source = 000000000000001).

{NFPAG=00:3000;02:2000:03:5-07:123456789-08:15122008-09:000000000000001;}

Note: All payment methods must be separated by ; (semicolon), including the last one must be ended by ;

FieldTypeDescription
730Maximum number of payment methods to be sent using the NFPAG parameter. 0 for no limit.
731Payment Type Enabled, repeats “n” times, where “n” is the number of payment methods enabled:
·       00: Money
·       01: Check
·       02: TEF Debit
·       03: TEF Credit
·       04: Carrefour Gift Card (Prepaid)
·       05: Carrefour Bonus Card
·       06: Carrefour Card
·       07: Withdrawal for payment
·       08: Loot
·       09: DCC Carrefour
·       10: Electronic Ticket
·       11: Paper Ticket
·       12: Digital Wallet
·       13: Pix
·       50: TEF Card
·       77: Reserved Field
·       98: No Payment
·       99: Other Forms
732Data to be sent for the Payment Type (Field 731) previously returned, repeats “n” times, where “n” is the number of data to be sent for the respective Payment Type:
·       00: Reserved Field
·       01: Check Entry Type
·          o ‘0’: CMC-7 reading
·          o ‘1’: typing the first line of the check
·          o ‘2’: CMC-7 typing
·       02: Check Data
·          the CMC-7 read or typed, or
·          o Typing the first line of the check, with the following format:
·           o Clearing (3), Bank (3), Agency (4), C1 (1), Current Account (10), C2 (1), Check Number (6) and C3 (1), in that order.
·       03: Destination Network (Field 131)
            Identification of the authorizer of the TEF transaction.
·       04: SiTef NSU of the TEF transaction (Field 133)
            Identification of the TEF transaction in SiTef.
·       05: SiTef date of the TEF transaction
            Not used (Future use).
·       06: Company Code of the TEF transaction
            SiTef code for the Company used in the TEF transaction.
·       07: TEF transaction Host NSU (Field 134)
            Identification of the TEF transaction on the Host.
·       08: Host Date of the EFT transaction (Field 105)
            Date of the EFT transaction on the Host, in DDMYYY format.
·       09: Origin Code of the TEF transaction (Field 157)
            Establishment Code of the TEF transaction.
·       10: Service Z of the TEF transaction (Field 1)
            Value of service Z returned by the Sit module responsible for the TEF transaction.
           o Pass only the confirmation data, removing the data from the SiTef index and SiTef address if any, follow the format of this field:
             DataConfirmation;SiTefIndex;SiTefAddress
Another option would be to use the following configuration in the CliSiTef.ini file:
[General]
DevolveConfirmacaoExtendida=0
Using this configuration, even in the case of multiple SiTef, only Service Z will be returned in field 1 of the CliSiTef, this way it is also not necessary to change the value of the field when placing the NFPAG prefix.
·       11: Authorization Code for the TEF transaction (Field 135)
            Host Authorization Code for the EFT transaction.
·       12: Check Amount
            Total Check Amount. The same check can be used to pay more than one bill
·       13: Destination Network – Complement
            ID 03 complement (see description below)
·       14: Card Flag
            Flag of the Card used in the TEF transaction
·       15: Payment Type
         ‘00’ – the view
         ‘01’ – Pre-dated
         ‘02’ – Paid in installments by the establishment
         ‘03’ - Paid in installments by the administrator
·       16: Digital Wallet Id
            (returns in field 106 of Sale with Digital Wallet)

The ID 13 field, unlike the others, does not indicate a field that must be collected, it works only as a complement to the ID field 03, sending the list of permitted Destination Networks, in the following format:

IDColetaNn(Network1,Network2,...,NetworkN)

In other words, if only the ID 03 field is present, it must be collected the Destination Network, without any restrictions regarding the Networks that can pay the Recharge. However, if ID fields 03 and 13 are present, the The first indicates that the Destination Network must be collected, while the second indicates which Destination Networks are allowed for payment of the Recharge.

Furthermore, as the collection was indicated by ID 03, the POS must send the Destination Network to the Sit also through this ID (and not through ID 13).