The terminal API provides four ways to cancel or refund a payment:
Cancel a transaction - Cancel a payment before it has finished processing.
Refund to a card - Refund an authorised payment to a card.
Refund a completed payment - Refund using a transaction ID if the card that made the payment originally is not available.
Make a referenced partial refund - Use a ReversalRequest to refund part of the value of a transaction to a card.