src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerMontrada.class.php
public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
    {
        $bPaymentOk = parent::ExecutePayment($oOrder);

        $aCommand = array('trefnum' => $this->sMontradaTransactionId, 'amount' => round($oOrder->fieldValueTotal * 100));
        $aAnswer = $this->ExecuteRequestCall('capture', $aCommand);
        if (array_key_exists('rc', $aAnswer) && '000' == $aAnswer['rc']) {
            $bPaymentOk = true;
            // add the response data to the order
            foreach ($aAnswer as $sKey => $sVal) {
                if (!array_key_exists($sKey, $this->aPaymentUserData)) {
                    $this->aPaymentUserData[$sKey] = $sVal;
                }
            }
            $this->SaveUserPaymentDataToOrder($oOrder->id);
            $oOrder->SetStatusPaid();
        } else {
            $bPaymentOk = false;
        }

        if (!$bPaymentOk) {
            // error!
            $sMsg = 'unbekannt';
            if (array_key_exists('rmsg', $aAnswer)) {
                $sMsg = $aAnswer['rmsg'];
            }
            $oMsgManager = TCMSMessageManager::GetInstance();
            $oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $sMsg));
        }

        return $bPaymentOk;
    }
public function ExecutePayment(TdbShopOrder &$oOrder, $sMessageConsumer = '')
    {
        $bPaymentOk = parent::ExecutePayment($oOrder);

        $aCommand = array('trefnum' => $this->sMontradaTransactionId, 'amount' => round($oOrder->fieldValueTotal * 100));
        $aAnswer = $this->ExecuteRequestCall('capture', $aCommand);
        if (array_key_exists('rc', $aAnswer) && '000' == $aAnswer['rc']) {
            $bPaymentOk = true;
            // add the response data to the order
            foreach ($aAnswer as $sKey => $sVal) {
                if (!array_key_exists($sKey, $this->aPaymentUserData)) {
                    $this->aPaymentUserData[$sKey] = $sVal;
                }
            }
            $this->SaveUserPaymentDataToOrder($oOrder->id);
            $oOrder->SetStatusPaid();
        } else {
            $bPaymentOk = false;
        }

        if (!$bPaymentOk) {
            // error!
            $sMsg = 'unbekannt';
            if (array_key_exists('rmsg', $aAnswer)) {
                $sMsg = $aAnswer['rmsg'];
            }
            $oMsgManager = TCMSMessageManager::GetInstance();
            $oMsgManager->AddMessage($sMessageConsumer, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => $sMsg));
        }

        return $bPaymentOk;
    }
public function ExecutePayment ( TdbShopOrder & $ oOrder , $ sMessageConsumer = '' ) { $ bPaymentOk = parent :: ExecutePayment ( $ oOrder ) ; $ aCommand = array ( 'trefnum' => $ this -> sMontradaTransactionId , 'amount' => round ( $ oOrder -> fieldValueTotal * 100 ) ) ; $ aAnswer = $ this -> ExecuteRequestCall ( 'capture' , $ aCommand ) ; if ( array_key_exists ( 'rc' , $ aAnswer ) && '000' == $ aAnswer [ 'rc' ] ) { $ bPaymentOk = true ; // add the response data to the order foreach ( $ aAnswer as $ sKey => $ sVal ) { if ( ! array_key_exists ( $ sKey , $ this -> aPaymentUserData ) ) { $ this -> aPaymentUserData [ $ sKey ] = $ sVal ; } } $ this -> SaveUserPaymentDataToOrder ( $ oOrder -> id ) ; $ oOrder -> SetStatusPaid ( ) ; } else { $ bPaymentOk = false ; } if ( ! $ bPaymentOk ) { // error! $ sMsg = 'unbekannt' ; if ( array_key_exists ( 'rmsg' , $ aAnswer ) ) { $ sMsg = $ aAnswer [ 'rmsg' ] ; } $ oMsgManager = TCMSMessageManager :: GetInstance ( ) ; $ oMsgManager -> AddMessage ( $ sMessageConsumer , 'ERROR-ORDER-REQUEST-PAYMENT-ERROR' , array ( 'errorMsg' => $ sMsg ) ) ; } return $ bPaymentOk ; }
executes payment for order - in this case, we commit the montrada payment.

@param TdbShopOrder $oOrder
@param string       $sMessageConsumer - send error messages here

@return bool
executes payment for order - in this case we commit the montrada payment .