code: public function zero(Transaction $transaction)
      {
          $amount = (int)$transaction->getAmount();
          $capture = (bool)$transaction->getCapture();
  
          $transaction->setAmount(0);
          $transaction->capture();
  
          $transaction = $this->create($transaction);
  
          $transaction->setAmount($amount);
          $transaction->capture($capture);
  
          return $transaction;
      }
docs: @param Transaction $transaction
  
  @return Transaction