original_string: public function execute()
      {
          parent::execute();
  
          $xml = new DOMDocument();
          $hpsTransaction = $xml->createElement('hps:Transaction');
          $hpsCreditAddToBatch = $xml->createElement('hps:CreditAddToBatch');
  
          $hpsCreditAddToBatch->appendChild($xml->createElement('hps:GatewayTxnId', $this->transactionId));
          if ($this->amount != null) {
              $amount = sprintf("%0.2f", round($this->amount, 3));
              $hpsCreditAddToBatch->appendChild($xml->createElement('hps:Amt', $amount));
          }
          if ($this->gratuity != null) {
              $hpsCreditAddToBatch->appendChild($xml->createElement('hps:GratuityAmtInfo', $this->gratuity));
          }
  
          if ($this->directMarketData != null && $this->directMarketData->invoiceNumber != null) {
              $hpsCreditAddToBatch->appendChild($this->_hydrateDirectMarketData($this->directMarketData, $xml));
          }
          $hpsTransaction->appendChild($hpsCreditAddToBatch);
          $response = $this->service->doRequest($hpsTransaction);
          $this->_processChargeGatewayResponse($response, 'CreditAddToBatch');
  
          return $this->service
              ->get($this->transactionId)
              ->execute();
      }
code: public function execute()
      {
          parent::execute();
  
          $xml = new DOMDocument();
          $hpsTransaction = $xml->createElement('hps:Transaction');
          $hpsCreditAddToBatch = $xml->createElement('hps:CreditAddToBatch');
  
          $hpsCreditAddToBatch->appendChild($xml->createElement('hps:GatewayTxnId', $this->transactionId));
          if ($this->amount != null) {
              $amount = sprintf("%0.2f", round($this->amount, 3));
              $hpsCreditAddToBatch->appendChild($xml->createElement('hps:Amt', $amount));
          }
          if ($this->gratuity != null) {
              $hpsCreditAddToBatch->appendChild($xml->createElement('hps:GratuityAmtInfo', $this->gratuity));
          }
  
          if ($this->directMarketData != null && $this->directMarketData->invoiceNumber != null) {
              $hpsCreditAddToBatch->appendChild($this->_hydrateDirectMarketData($this->directMarketData, $xml));
          }
          $hpsTransaction->appendChild($hpsCreditAddToBatch);
          $response = $this->service->doRequest($hpsTransaction);
          $this->_processChargeGatewayResponse($response, 'CreditAddToBatch');
  
          return $this->service
              ->get($this->transactionId)
              ->execute();
      }
code_tokens: public function execute ( ) { parent :: execute ( ) ; $ xml = new DOMDocument ( ) ; $ hpsTransaction = $ xml -> createElement ( 'hps:Transaction' ) ; $ hpsCreditAddToBatch = $ xml -> createElement ( 'hps:CreditAddToBatch' ) ; $ hpsCreditAddToBatch -> appendChild ( $ xml -> createElement ( 'hps:GatewayTxnId' , $ this -> transactionId ) ) ; if ( $ this -> amount != null ) { $ amount = sprintf ( "%0.2f" , round ( $ this -> amount , 3 ) ) ; $ hpsCreditAddToBatch -> appendChild ( $ xml -> createElement ( 'hps:Amt' , $ amount ) ) ; } if ( $ this -> gratuity != null ) { $ hpsCreditAddToBatch -> appendChild ( $ xml -> createElement ( 'hps:GratuityAmtInfo' , $ this -> gratuity ) ) ; } if ( $ this -> directMarketData != null && $ this -> directMarketData -> invoiceNumber != null ) { $ hpsCreditAddToBatch -> appendChild ( $ this -> _hydrateDirectMarketData ( $ this -> directMarketData , $ xml ) ) ; } $ hpsTransaction -> appendChild ( $ hpsCreditAddToBatch ) ; $ response = $ this -> service -> doRequest ( $ hpsTransaction ) ; $ this -> _processChargeGatewayResponse ( $ response , 'CreditAddToBatch' ) ; return $ this -> service -> get ( $ this -> transactionId ) -> execute ( ) ; }
docstring: Creates a capture transaction through the HpsCreditService
docstring_tokens: Creates a capture transaction through the HpsCreditService