After-Capture Workflow {#opencart-wkfw-after-capture}
=====================================================

This workflow comprises the sequence of events that occur after an authorization is captured. The workflow shows how the order status is updated when the captured transaction is refunded or voided.

1. The merchant selects one of these actions:
   * Standard refund
   * Partial refund
   * Void capture
2. If the merchant voids the capture, the captured transactions are voided.  
   When all quantities of the transaction are captured, the entire order is voided and the order status is set to *Payment cancelled*.  
   If only a few quantities are captured, only the captured quantities are voided and the order status is set to *Partial payment accepted*.
3. If the merchant initiates a standard refund **before** updating the order status to *shipped* , the order status is set to *Partial refunded (before shipped)* until the refunded amount becomes equal to the captured amount. When the refunded amount becomes equal to the captured amount, the order status is set to *Refunded*.
   4. When the merchant selects a refund **after** updating the order status to *shipped* , the order status is set to *Partial refunded (after shipped)* until the refunded amount becomes equal to the captured amount. When the refunded amount becomes equal to the captured amount, the order status is set to *Refunded*.  
      To refund the amount of an order, merchants can either generate a voucher or a credit slip for the refund. Depending on the type of refund they select and whether they issue a voucher or a credit slip, one of these actions occurs:
   * When the merchant chooses Generate a voucher for a partial refund, the sum of the items is not refunded. Instead, a voucher is generated that can be used for future transactions.
   * When the merchant chooses Generate a voucher and enters the amount in the shipping costs field for a partial refund, then a voucher equal to the sum of the items and the shipping amount is generated.
   * When the merchant chooses Generate a credit slip for a standard refund, the sum of the items is refunded.
   * When the merchant chooses both Generate a credit slip and Repay shipping costs for a standard refund, the sum of the items and the shipping amount are both refunded.
   * When the merchant chooses both Generate a voucher and Repay shipping costs for a standard refund, a voucher equal to the sum of the items and shipping amount is generated.

* When the merchant chooses both Generate a voucher and Generate credit slip for a standard refund, a voucher is generated and a refund for the sum of the items is not generated.

