public function cancel(Transaction $transaction)
    {
        $cancelResult = $this->process($transaction, Operation::CANCEL);

        if ($transaction instanceof CreditCardTransaction
            && $cancelResult->getStatusCollection()->hasStatusCodes(['500.1057'])
        ) {
            return $this->process($transaction, Operation::REFUND);
        }

        return $cancelResult;
    }