getModuleProvider()->isHeidelpayInterfaceMGWRestActive()) { return parent::executePayment($dAmount, $oOrder); } /** @var ControllerPaymentGateway $oGatewayFacade */ $oGatewayFacade = oxNew(ControllerPaymentGateway::class, $oOrder, $oFactory); //TODO: compose Transaction in dependency of payment and paymntcode $oTransAction = $oFactory->getLatestTransactionByReference($oFactory->getReferenceNumber()); if (false == $oTransAction) { /** @var d3transactionlog $oTransAction */ $oTransAction = oxNew( d3transactionlog::class, oxNew(TransactionlogReader::class), $oFactory->getReferenceNumber() ); $oTransAction->setTransactiondata(''); } /** @var Parser $oParser */ $oParser = oxNew(Parser::class, $oTransAction->getTransactiondata()); $mReturn = $oGatewayFacade->executePayment($this->getPayment(), $oParser); $oFactory->getModuleConfiguration()->d3getLog()->info( self::class, __FUNCTION__, __LINE__, 'paymentgateway return value', print_r(var_export($mReturn, true), true) ); if (ControllerPaymentGateway::PAYMENTGATEWAY_CALLPARENT === $mReturn) { return parent::executePayment($dAmount, $oOrder); } //payment successful if (true === $mReturn) { return $mReturn; } //wrong result -> got error / message $this->_iLastErrorNo = $mReturn; return false; } /** * Load and returns oxPayment object. * * @return Payment * @throws SystemComponentException */ public function getPayment() { /** @var Payment $oPayment */ $oPayment = oxNew(Payment::class); $oPayment->load($this->_oPaymentInfo->oxuserpayments__oxpaymentsid->value); return $oPayment; } }