public function reverse($transactionId, $amount, $trackData, $authorizedAmount = null, HpsEncryptionData $encryptionData = null, HpsTransactionDetails $details = null, $clientTransactionId = null)
    {
        HpsInputValidation::checkAmount($amount);

        /* Build the transaction request. */
        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsGiftCard = $xml->createElement('hps:DebitReversal');
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));
        $hpsBlock1->appendChild($xml->createElement('hps:TrackData', $trackData));
        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $amount));
        if ($encryptionData != null) {
            $hpsBlock1->appendChild($this->_hydrateEncryptionData($encryptionData, $xml));
        }
        if ($details != null) {
            $hpsBlock1->appendChild($this->_hydrateAdditionalTxnFields($details, $xml));
        }


        if (isset($authorizedAmount)) {
            $hpsBlock1->appendChild($xml->createElement('hps:authAmt', $authorizedAmount));
            $hpsBlock1->appendChild($xml->createElement('hps:authAmtSpecified', true));
        }

        $hpsGiftCard->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsGiftCard);

        $rsp = $this->_submitTransaction($hpsTransaction, 'DebitReversal', $clientTransactionId);
        $rsp->responseCode = '00';
        $rsp->responseText = '';

        return $rsp;
    }
public function reverse($transactionId, $amount, $trackData, $authorizedAmount = null, HpsEncryptionData $encryptionData = null, HpsTransactionDetails $details = null, $clientTransactionId = null)
    {
        HpsInputValidation::checkAmount($amount);

        /* Build the transaction request. */
        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsGiftCard = $xml->createElement('hps:DebitReversal');
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));
        $hpsBlock1->appendChild($xml->createElement('hps:TrackData', $trackData));
        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $amount));
        if ($encryptionData != null) {
            $hpsBlock1->appendChild($this->_hydrateEncryptionData($encryptionData, $xml));
        }
        if ($details != null) {
            $hpsBlock1->appendChild($this->_hydrateAdditionalTxnFields($details, $xml));
        }


        if (isset($authorizedAmount)) {
            $hpsBlock1->appendChild($xml->createElement('hps:authAmt', $authorizedAmount));
            $hpsBlock1->appendChild($xml->createElement('hps:authAmtSpecified', true));
        }

        $hpsGiftCard->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsGiftCard);

        $rsp = $this->_submitTransaction($hpsTransaction, 'DebitReversal', $clientTransactionId);
        $rsp->responseCode = '00';
        $rsp->responseText = '';

        return $rsp;
    }
public function reverse ( $ transactionId , $ amount , $ trackData , $ authorizedAmount = null , HpsEncryptionData $ encryptionData = null , HpsTransactionDetails $ details = null , $ clientTransactionId = null ) { HpsInputValidation :: checkAmount ( $ amount ) ; /* Build the transaction request. */ $ xml = new DOMDocument ( ) ; $ hpsTransaction = $ xml -> createElement ( 'hps:Transaction' ) ; $ hpsGiftCard = $ xml -> createElement ( 'hps:DebitReversal' ) ; $ hpsBlock1 = $ xml -> createElement ( 'hps:Block1' ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:GatewayTxnId' , $ transactionId ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:TrackData' , $ trackData ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:Amt' , $ amount ) ) ; if ( $ encryptionData != null ) { $ hpsBlock1 -> appendChild ( $ this -> _hydrateEncryptionData ( $ encryptionData , $ xml ) ) ; } if ( $ details != null ) { $ hpsBlock1 -> appendChild ( $ this -> _hydrateAdditionalTxnFields ( $ details , $ xml ) ) ; } if ( isset ( $ authorizedAmount ) ) { $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:authAmt' , $ authorizedAmount ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:authAmtSpecified' , true ) ) ; } $ hpsGiftCard -> appendChild ( $ hpsBlock1 ) ; $ hpsTransaction -> appendChild ( $ hpsGiftCard ) ; $ rsp = $ this -> _submitTransaction ( $ hpsTransaction , 'DebitReversal' , $ clientTransactionId ) ; $ rsp -> responseCode = '00' ; $ rsp -> responseText = '' ; return $ rsp ; }
A Debit Reversal transaction reverses a Debit Charge or Debit Return transaction.

@param string                $transactionId       The gateway transaciton ID of the charge to be reversed.
@param double                $amount              Authorization amount.
@param string                $trackData           Track data read from the card by the card reader.
@param double                $authorizedAmount    Settlement amount or New Authorization amount after reversal occures.
@param HpsEncryptionData     $encryptionData      E3 encryption data group.
@param HpsTransactionDetails $details             Group containing additional transaction fields to be included in detail reporting.
@param string                $clientTransactionId Optional client transaction ID.

@return HpsDebitReversal The reversal result.
A Debit Reversal transaction reverses a Debit Charge or Debit Return transaction .