public function addValue($amount, $currency, $trackData, $pinBlock, HpsEncryptionData $encryptionData = null, $allowDuplicates = false, HpsCardHolder $cardHolder = null, HpsTransactionDetails $details = null, $clientTransactionId = null)
    {
        HpsInputValidation::checkAmount($amount);
        HpsInputValidation::checkCurrency($currency);

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

        $hpsBlock1->appendChild($xml->createElement('hps:TrackData', $trackData));
        $hpsBlock1->appendChild($xml->createElement('hps:AllowDup', ($allowDuplicates ? 'Y' : 'N')));
        if ($cardHolder != null) {
            $hpsBlock1->appendChild($this->_hydrateCardHolderData($cardHolder, $xml));
        }
        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $amount));
        $hpsBlock1->appendChild($xml->createElement('hps:PinBlock', $pinBlock));
        if ($encryptionData != null) {
            $hpsBlock1->appendChild($this->_hydrateEncryptionData($encryptionData, $xml));
        }
        if ($details != null) {
            $hpsBlock1->appendChild($this->_hydrateAdditionalTxnFields($details, $xml));
        }

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

        return $this->_submitTransaction($hpsTransaction, 'DebitAddValue', $clientTransactionId);
    }
public function addValue($amount, $currency, $trackData, $pinBlock, HpsEncryptionData $encryptionData = null, $allowDuplicates = false, HpsCardHolder $cardHolder = null, HpsTransactionDetails $details = null, $clientTransactionId = null)
    {
        HpsInputValidation::checkAmount($amount);
        HpsInputValidation::checkCurrency($currency);

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

        $hpsBlock1->appendChild($xml->createElement('hps:TrackData', $trackData));
        $hpsBlock1->appendChild($xml->createElement('hps:AllowDup', ($allowDuplicates ? 'Y' : 'N')));
        if ($cardHolder != null) {
            $hpsBlock1->appendChild($this->_hydrateCardHolderData($cardHolder, $xml));
        }
        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $amount));
        $hpsBlock1->appendChild($xml->createElement('hps:PinBlock', $pinBlock));
        if ($encryptionData != null) {
            $hpsBlock1->appendChild($this->_hydrateEncryptionData($encryptionData, $xml));
        }
        if ($details != null) {
            $hpsBlock1->appendChild($this->_hydrateAdditionalTxnFields($details, $xml));
        }

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

        return $this->_submitTransaction($hpsTransaction, 'DebitAddValue', $clientTransactionId);
    }
public function addValue ( $ amount , $ currency , $ trackData , $ pinBlock , HpsEncryptionData $ encryptionData = null , $ allowDuplicates = false , HpsCardHolder $ cardHolder = null , HpsTransactionDetails $ details = null , $ clientTransactionId = null ) { HpsInputValidation :: checkAmount ( $ amount ) ; HpsInputValidation :: checkCurrency ( $ currency ) ; /* Build the transaction request. */ $ xml = new DOMDocument ( ) ; $ hpsTransaction = $ xml -> createElement ( 'hps:Transaction' ) ; $ hpsGiftCard = $ xml -> createElement ( 'hps:DebitAddValue' ) ; $ hpsBlock1 = $ xml -> createElement ( 'hps:Block1' ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:TrackData' , $ trackData ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:AllowDup' , ( $ allowDuplicates ? 'Y' : 'N' ) ) ) ; if ( $ cardHolder != null ) { $ hpsBlock1 -> appendChild ( $ this -> _hydrateCardHolderData ( $ cardHolder , $ xml ) ) ; } $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:Amt' , $ amount ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:PinBlock' , $ pinBlock ) ) ; if ( $ encryptionData != null ) { $ hpsBlock1 -> appendChild ( $ this -> _hydrateEncryptionData ( $ encryptionData , $ xml ) ) ; } if ( $ details != null ) { $ hpsBlock1 -> appendChild ( $ this -> _hydrateAdditionalTxnFields ( $ details , $ xml ) ) ; } $ hpsGiftCard -> appendChild ( $ hpsBlock1 ) ; $ hpsTransaction -> appendChild ( $ hpsGiftCard ) ; return $ this -> _submitTransaction ( $ hpsTransaction , 'DebitAddValue' , $ clientTransactionId ) ; }
The Debit Add Value transaction adds value to a stored value card. The transaction is placed in the current
open batch. If a batch is not open, this transaction creates an open batch.

@param double                $amount              Authorization amount.
@param string                $currency            Currency ("usd")
@param string                $trackData           Track data read from the card by the card reader.
@param string                $pinBlock            PIN block.
@param HpsEncryptionData     $encryptionData      E3 encryption data group.
@param bool                  $allowDuplicates     Indicates whether to allow duplicate transactions.
@param HpsCardHolder         $cardHolder          Card holder information.
@param HpsTransactionDetails $details             Group containing additional transaction fields to be included in detail reporting.
@param string                $clientTransactionId Optional client transaction ID.

@return HpsDebitAddValue The AddValue (Authorization) response.
The Debit Add Value transaction adds value to a stored value card . The transaction is placed in the current open batch . If a batch is not open this transaction creates an open batch .