<?php
/**
 * Class d3_oxinputvalidator_heidelpay
 */
class d3_oxinputvalidator_heidelpay extends d3_oxinputvalidator_heidelpay_parent
{

    /**
     * {@inheritdoc}
     */
    public function validatePaymentInputData($sPaymentId, &$aDynvalue)
    {
        if (false == d3_cfg_mod::get('d3heidelpay')->isActive()) {
            return parent::validatePaymentInputData($sPaymentId, $aDynvalue);
        }
        /** @var d3_d3heidelpay_models_settings_heidelpay $oSettings */
        $oSettings = oxNew('d3_d3heidelpay_models_settings_heidelpay', d3_cfg_mod::get('d3heidelpay'));
        oxRegistry::set('d3_d3heidelpay_models_settings_heidelpay', $oSettings);

        /** @var d3_d3heidelpay_models_verify_input $oVerify */
        $oVerify = oxNew('d3_d3heidelpay_models_verify_input', oxRegistry::get('oxRegistry'), $sPaymentId, $aDynvalue);
        $mReturn = $oVerify->verify();

        if ($mReturn === 'callParent') {
            return parent::validatePaymentInputData($sPaymentId, $aDynvalue);
        }

        return $mReturn;
    }
}
