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

        HpsInputValidation::checkAmount($this->amount);

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

        $hpsBlock1->appendChild($xml->createElement('hps:Amt', sprintf("%0.2f", round($this->amount, 3))));
        $hpsBlock1->appendChild($xml->createElement('hps:CheckAction', 'SALE'));
        $hpsBlock1->appendChild($xml->createElement('hps:PaymentMethodKey', $this->paymentMethodKey));

        $recurringData = $xml->createElement('hps:RecurringData');
        if ($this->schedule != null) {
            $scheduleKey = $this->schedule;
            if ($this->schedule instanceof HpsPayPlanSchedule) {
                $scheduleKey = $this->schedule->scheduleKey;
            }
            $recurringData->appendChild($xml->createElement('hps:ScheduleID', $scheduleKey));
        }
        $recurringData->appendChild($xml->createElement('hps:OneTime', ($this->oneTime ? 'Y' : 'N')));

        $hpsBlock1->appendChild($recurringData);
        $hpsCheckSale->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsCheckSale);

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

        HpsInputValidation::checkAmount($this->amount);

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

        $hpsBlock1->appendChild($xml->createElement('hps:Amt', sprintf("%0.2f", round($this->amount, 3))));
        $hpsBlock1->appendChild($xml->createElement('hps:CheckAction', 'SALE'));
        $hpsBlock1->appendChild($xml->createElement('hps:PaymentMethodKey', $this->paymentMethodKey));

        $recurringData = $xml->createElement('hps:RecurringData');
        if ($this->schedule != null) {
            $scheduleKey = $this->schedule;
            if ($this->schedule instanceof HpsPayPlanSchedule) {
                $scheduleKey = $this->schedule->scheduleKey;
            }
            $recurringData->appendChild($xml->createElement('hps:ScheduleID', $scheduleKey));
        }
        $recurringData->appendChild($xml->createElement('hps:OneTime', ($this->oneTime ? 'Y' : 'N')));

        $hpsBlock1->appendChild($recurringData);
        $hpsCheckSale->appendChild($hpsBlock1);
        $hpsTransaction->appendChild($hpsCheckSale);

        return $this->service->_submitTransaction($hpsTransaction, 'CheckSale');
    }
public function execute ( ) { parent :: execute ( ) ; HpsInputValidation :: checkAmount ( $ this -> amount ) ; $ xml = new DOMDocument ( ) ; $ hpsTransaction = $ xml -> createElement ( 'hps:Transaction' ) ; $ hpsCheckSale = $ xml -> createElement ( 'hps:CheckSale' ) ; $ hpsBlock1 = $ xml -> createElement ( 'hps:Block1' ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:Amt' , sprintf ( "%0.2f" , round ( $ this -> amount , 3 ) ) ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:CheckAction' , 'SALE' ) ) ; $ hpsBlock1 -> appendChild ( $ xml -> createElement ( 'hps:PaymentMethodKey' , $ this -> paymentMethodKey ) ) ; $ recurringData = $ xml -> createElement ( 'hps:RecurringData' ) ; if ( $ this -> schedule != null ) { $ scheduleKey = $ this -> schedule ; if ( $ this -> schedule instanceof HpsPayPlanSchedule ) { $ scheduleKey = $ this -> schedule -> scheduleKey ; } $ recurringData -> appendChild ( $ xml -> createElement ( 'hps:ScheduleID' , $ scheduleKey ) ) ; } $ recurringData -> appendChild ( $ xml -> createElement ( 'hps:OneTime' , ( $ this -> oneTime ? 'Y' : 'N' ) ) ) ; $ hpsBlock1 -> appendChild ( $ recurringData ) ; $ hpsCheckSale -> appendChild ( $ hpsBlock1 ) ; $ hpsTransaction -> appendChild ( $ hpsCheckSale ) ; return $ this -> service -> _submitTransaction ( $ hpsTransaction , 'CheckSale' ) ; }
Creates a sale transaction through the HpsCheckService
Creates a sale transaction through the HpsCheckService