Ciclo de vida do cancelamento

👍

CANCELAMENTO

Quando uma transação é cancelada no dia de referência, um nó Transaction referente a ela aparecerá sob FinancialTransactions no arquivo de conciliação desse dia com o evento Cancellations com o valor 1 em Event, dentro do nó Transaction aparecerá um nó chamado Cancellations que descreve cada cancelamento (vários se houver cancelamentos parciais, ou apenas um se for cancelamento total)

Exemplos de ciclo de vida do cancelamento:

Captura (10/05) > Liquidação da Parcela (09/06) > Cancelamento (10/06) > Desconto do Cancelamento (12/06)

Note que no dia 10/06 encaminhamos o aviso sobre a transação cancelada e passamos a data prevista para sensibilizarmos o saldo do lojista.

<FinancialTransactions>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>0</Cancellations>
            <Captures>1</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>0</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <International>True</International>
        <AccountType>2</AccountType>
        <InstallmentType>1</InstallmentType>
        <NumberOfInstallments>1</NumberOfInstallments>
        <AuthorizedAmount>694.000000</AuthorizedAmount>
        <CapturedAmount>694.000000</CapturedAmount>
        <AuthorizationCurrencyCode>986</AuthorizationCurrencyCode>
        <IssuerAuthorizationCode>054973</IssuerAuthorizationCode>
        <BrandId>1</BrandId>
        <CardNumber>411111******1111</CardNumber>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Installments>
            <Installment>
                <InstallmentNumber>1</InstallmentNumber>
                <GrossAmount>694.000000</GrossAmount>
                <NetAmount>678.454400</NetAmount>
                <PrevisionPaymentDate>20160609</PrevisionPaymentDate>
            </Installment>
        </Installments>
    </Transaction>
    ...
</FinancialTransactions>
<FinancialTransactionsAccounts>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>0</Cancellations>
            <Captures>0</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>1</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Installments>
            <Installment>
                <InstallmentNumber>1</InstallmentNumber>
                <GrossAmount>694.000000</GrossAmount>
                <NetAmount>678.454400</NetAmount>
                <PaymentDate>20160609</PaymentDate>
                <PaymentId>1234567</PaymentId>
            </Installment>
        </Installments>
    </Transaction>
    ...
</FinancialTransactionsAccounts>
...
<Payments>
    <Payment>
        <Id>1234567</Id>
        <WalletTypeId>3</WalletTypeId>
        <TotalAmount>14185.81</TotalAmount>
        <TotalFinancialAccountsAmount>14185.81</TotalFinancialAccountsAmount>
        <LastNegativeAmount>0.00</LastNegativeAmount>
        <FavoredBankAccount>
            <BankCode>XX</BankCode>
            <BankBranch>XXXX</BankBranch>
            <BankAccountNumber>XXXXXXXXX</BankAccountNumber>
        </FavoredBankAccount>
    </Payment>
</Payments>
<FinancialTransactions>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>1</Cancellations>
            <Captures>0</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>0</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Cancellations>
            <Cancellation>
                <InstallmentNumber>1</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>694.000000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>678.454400</ChargedAmount>
                    <PrevisionChargeDate>20160613</PrevisionChargeDate>
                </Billing>
            </Cancellation>
        </Cancellations>
    </Transaction>
    ...
</FinancialTransactions>
<FinancialTransactionsAccounts>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>1</CancellationCharges>
            <Cancellations>0</Cancellations>
            <Captures>0</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>0</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Cancellations>
            <Cancellation>
                <InstallmentNumber>1</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>694.000000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>678.454400</ChargedAmount>
                    <ChargeDate>20160613</ChargeDate>
                </Billing>
            </Cancellation>
        </Cancellations>
    </Transaction>
    ...
</FinancialTransactionsAccounts>

Captura (10/05) > Liquidação da Parcela (09/06) > Cancelamento (10/06) > Desconto do Cancelamento (12/06)

Nesse cenário temos o Cancelamento sendo feito após a liquidação da parcela.

<FinancialTransactions>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>0</Cancellations>
            <Captures>1</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>0</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <International>True</International>
        <AccountType>2</AccountType>
        <InstallmentType>1</InstallmentType>
        <NumberOfInstallments>3</NumberOfInstallments>
        <AuthorizedAmount>1099.000000</AuthorizedAmount>
        <CapturedAmount>694.000000</CapturedAmount>
        <AuthorizationCurrencyCode>986</AuthorizationCurrencyCode>
        <IssuerAuthorizationCode>054973</IssuerAuthorizationCode>
        <BrandId>1</BrandId>
        <CardNumber>411111******1111</CardNumber>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Installments>
            <Installment>
                <InstallmentNumber>1</InstallmentNumber>
                <GrossAmount>366.340000</GrossAmount>
                <NetAmount>357.657742</NetAmount>
                <PrevisionPaymentDate>20160609</PrevisionPaymentDate>
            </Installment>
            <Installment>
                <InstallmentNumber>2</InstallmentNumber>
                <GrossAmount>366.330000</GrossAmount>
                <NetAmount>357.647979</NetAmount>
                <PrevisionPaymentDate>20160709</PrevisionPaymentDate>
            </Installment>
            <Installment>
                <InstallmentNumber>3</InstallmentNumber>
                <GrossAmount>366.330000</GrossAmount>
                <NetAmount>357.647979</NetAmount>
                <PrevisionPaymentDate>20160809</PrevisionPaymentDate>
            </Installment>
        </Installments>
    </Transaction>
    ...
</FinancialTransactions>
<FinancialTransactionsAccounts>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>0</Cancellations>
            <Captures>0</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>1</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Installments>
            <Installment>
                <InstallmentNumber>1</InstallmentNumber>
                <GrossAmount>366.340000</GrossAmount>
                <NetAmount>357.657742</NetAmount>
                <PaymentDate>20160609</PaymentDate>
                <PaymentId>1234567</PaymentId>
            </Installment>
        </Installments>
    </Transaction>
    ...
</FinancialTransactionsAccounts>
...
<Payments>
    <Payment>
        <Id>1234567</Id>
        <WalletTypeId>3</WalletTypeId>
        <TotalAmount>14185.81</TotalAmount>
        <TotalFinancialAccountsAmount>14185.81</TotalFinancialAccountsAmount>
        <LastNegativeAmount>0.00</LastNegativeAmount>
        <FavoredBankAccount>
            <BankCode>XX</BankCode>
            <BankBranch>XXXX</BankBranch>
            <BankAccountNumber>XXXXXXXXX</BankAccountNumber>
        </FavoredBankAccount>
    </Payment>
</Payments>
<FinancialTransactions>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>1</Cancellations>
            <Captures>0</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>0</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Cancellations>
            <Cancellation>
                <InstallmentNumber>1</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>366.340000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>357.657742</ChargedAmount>
                    <PrevisionChargeDate>20160612</PrevisionChargeDate>
                </Billing>
            </Cancellation>
            <Cancellation>
                <InstallmentNumber>2</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>366.330000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>357.647979</ChargedAmount>
                    <PrevisionChargeDate>20160612</PrevisionChargeDate>
                </Billing>
            </Cancellation>
            <Cancellation>
                <InstallmentNumber>3</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>366.330000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>357.647979</ChargedAmount>
                    <PrevisionChargeDate>20160612</PrevisionChargeDate>
                </Billing>
            </Cancellation>
        </Cancellations>
    </Transaction>
    ...
</FinancialTransactions>
<FinancialTransactionsAccounts>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>3</CancellationCharges>
            <Cancellations>0</Cancellations>
            <Captures>0</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>2</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Installments>
            <!--Aceleração das parcelas-->
            <Installment>
                <InstallmentNumber>2</InstallmentNumber>
                <GrossAmount>366.330000</GrossAmount>
                <NetAmount>357.647979</NetAmount>
                <PaymentDate>20160612</PaymentDate>
                <PaymentId>1234567</PaymentId>
            </Installment>
            <Installment>
                <InstallmentNumber>3</InstallmentNumber>
                <GrossAmount>366.330000</GrossAmount>
                <NetAmount>357.647979</NetAmount>
                <PaymentDate>20160612</PaymentDate>
                <PaymentId>1234567</PaymentId>
            </Installment>
        </Installments>
        <Cancellations>
            <!--Cancelamento das parcelas aceleradas-->
            <Cancellation>
                <InstallmentNumber>1</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>366.340000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>357.657742</ChargedAmount>
                    <ChargeDate>20160612</ChargeDate>
                </Billing>
            </Cancellation>
            <Cancellation>
                <InstallmentNumber>2</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>366.330000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>357.647979</ChargedAmount>
                    <ChargeDate>20160612</ChargeDate>
                </Billing>
            </Cancellation>
            <Cancellation>
                <InstallmentNumber>3</InstallmentNumber>
                <OperationKey>2276000071307928</OperationKey>
                <CancellationDateTime>20160610040236</CancellationDateTime>
                <ReturnedAmount>366.330000</ReturnedAmount>
                <Billing>
                    <ChargedAmount>357.647979</ChargedAmount>
                    <ChargeDate>20160612</ChargeDate>
                </Billing>
            </Cancellation>
        </Cancellations>
    </Transaction>
    ...
</FinancialTransactionsAccounts>

📘

Aceleração de parcelas

Acima podemos ver o exemplo de um fluxo de Aceleração de parcelas. Ou seja, se eu tenho uma transação de 2 parcelas, e após a liquidação da primeira parcela é enviado um cancelamento, no dia do desconto do cancelamento, é feita a aceleração da liquidação das parcelas restantes para liberar o saldo do cliente. Perceba que a PaymentDate no dia 12/06 foi antecipada.

Captura (10/05) > Cancelamento (10/05)

Quando temos o Cancelamento sendo efetivado no mesmo dia da Captura, temos tanto a flag de Capture como Cancellations habilitadas,

<FinancialTransactions>
    ...
    <Transaction>
        <Events>
            <CancellationCharges>0</CancellationCharges>
            <Cancellations>1</Cancellations>
            <Captures>1</Captures>
            <ChargebackRefunds>0</ChargebackRefunds>
            <Chargebacks>0</Chargebacks>
            <Payments>0</Payments>
        </Events>
        <AcquirerTransactionKey>99960072739732</AcquirerTransactionKey>
        <InitiatorTransactionKey>123456789</InitiatorTransactionKey>
        <AuthorizationDateTime>20160509154748</AuthorizationDateTime>
        <CaptureLocalDateTime>20160510082639</CaptureLocalDateTime>
        <International>True</International>
        <AccountType>2</AccountType>
        <InstallmentType>1</InstallmentType>
        <NumberOfInstallments>3</NumberOfInstallments>
        <AuthorizedAmount>1099.000000</AuthorizedAmount>
        <CapturedAmount>694.000000</CapturedAmount>
        <AuthorizationCurrencyCode>986</AuthorizationCurrencyCode>
        <IssuerAuthorizationCode>054973</IssuerAuthorizationCode>
        <BrandId>1</BrandId>
        <CardNumber>411111******1111</CardNumber>
        <Poi>
            <PoiType>4</PoiType>
        </Poi>
        <EntryMode>1</EntryMode>
        <Cancellations>
            <Cancellation>
                <OperationKey>2316000073093085</OperationKey>
                <CancellationDateTime>20160510104014</CancellationDateTime>
                <ReturnedAmount>694.000000</ReturnedAmount>
            </Cancellation>
        </Cancellations>
    </Transaction>
    ...
</FinancialTransactions>

📘

Captura + cancelamento

Repare que quando o cancelamento é feito no mesmo dia da captura, o nó Billing não aparece, ou seja, não é agendado uma data de desconto do cancelamento.