public function execute()
    {
        parent::execute();

        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsCreditAuth = $xml->createElement('hps:PrePaidAddValue');
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $this->amount));
        $hpsBlock1->appendChild($xml->createElement('hps:AllowDup', ($this->allowDuplicates ? 'Y' : 'N')));

        $cardData = $xml->createElement('hps:CardData');
        if ($this->card != null) {
            $cardData->appendChild($this->service->_hydrateManualEntry($this->card, $xml));
        } else if ($this->trackData != null) {
            $cardData->appendChild($this->service->_hydrateTrackData($this->trackData, $xml));
        } else if ($this->token != null) {
            $cardData->appendChild($this->service->_hydrateTokenData($this->token, $xml));
        }

        $hpsBlock1->appendChild($cardData);
        $hpsCreditAuth->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsCreditAuth);

        return $this->service->_submitTransaction($hpsTransaction, 'PrePaidAddValue');
    }
public function execute()
    {
        parent::execute();

        $xml = new DOMDocument();
        $hpsTransaction = $xml->createElement('hps:Transaction');
        $hpsCreditAuth = $xml->createElement('hps:PrePaidAddValue');
        $hpsBlock1 = $xml->createElement('hps:Block1');

        $hpsBlock1->appendChild($xml->createElement('hps:Amt', $this->amount));
        $hpsBlock1->appendChild($xml->createElement('hps:AllowDup', ($this->allowDuplicates ? 'Y' : 'N')));

        $cardData = $xml->createElement('hps:CardData');
        if ($this->card != null) {
            $cardData->appendChild($this->service->_hydrateManualEntry($this->card, $xml));
        } else if ($this->trackData != null) {
            $cardData->appendChild($this->service->_hydrateTrackData($this->trackData, $xml));
        } else if ($this->token != null) {
            $cardData->appendChild($this->service->_hydrateTokenData($this->token, $xml));
        }

        $hpsBlock1->appendChild($cardData);
        $hpsCreditAuth->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsCreditAuth);

        return $this->service->_submitTransaction($hpsTransaction, 'PrePaidAddValue');
    }
public function execute ( ) { parent :: execute ( ) ; $ xml = new DOMDocument ( ) ; $ hpsTransaction = $ xml -> createElement ( 'hps:Transaction' ) ; $ hpsCreditAuth = $ xml -> createElement ( 'hps:PrePaidAddValue' ) ; $ hpsBlock1 = $ xml -> createElement ( 'hps:Block1' ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:Amt' , $ this -> amount ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:AllowDup' , ( $ this -> allowDuplicates ? 'Y' : 'N' ) ) ) ; $ cardData = $ xml -> createElement ( 'hps:CardData' ) ; if ( $ this -> card != null ) { $ cardData -> appendChild ( $ this -> service -> _hydrateManualEntry ( $ this -> card , $ xml ) ) ; } else if ( $ this -> trackData != null ) { $ cardData -> appendChild ( $ this -> service -> _hydrateTrackData ( $ this -> trackData , $ xml ) ) ; } else if ( $ this -> token != null ) { $ cardData -> appendChild ( $ this -> service -> _hydrateTokenData ( $ this -> token , $ xml ) ) ; } $ hpsBlock1 -> appendChild ( $ cardData ) ; $ hpsCreditAuth -> appendChild ( $ hpsBlock1 ) ; $ hpsTransaction -> appendChild ( $ hpsCreditAuth ) ; return $ this -> service -> _submitTransaction ( $ hpsTransaction , 'PrePaidAddValue' ) ; }
Creates an add value transaction through the HpsCreditService
Creates an add value transaction through the HpsCreditService