src/ShopBundle/objects/WebModules/MTShopOrderWizardCore/MTShopOrderWizardCoreEndPoint.class.php
protected function JumpSelectPaymentMethod($sPaymentMethodId = null, $sPaymentMethodNameInternal = null)
    {
        $oPaymentMethod = null;
        if (is_null($sPaymentMethodId)) {
            $sPaymentMethodId = $this->global->GetUserData('sPaymentMethodId');
        }
        if (empty($sPaymentMethodId)) {
            $oPaymentMethod = TdbShopPaymentMethod::GetNewInstance();
            if (is_null($sPaymentMethodNameInternal)) {
                $sPaymentMethodNameInternal = $this->global->GetUserData('sPaymentMethodNameInternal');
            }
            $oPaymentMethod->LoadFromField('name_internal', $sPaymentMethodNameInternal);
        }

        if (is_null($oPaymentMethod)) {
            $oPaymentMethod = TdbShopPaymentMethod::GetNewInstance();
            $oPaymentMethod->Load($sPaymentMethodId);
        }

        if ($oPaymentMethod->IsAvailable()) {
            $oBasket = TShopBasket::GetInstance();
            $oBasket->SetActivePaymentMethod($oPaymentMethod);

            // check if payment method was set
            $oCheckPayment = $oBasket->GetActivePaymentMethod();
            if (!$oCheckPayment) {
                TTools::WriteLogEntry('JumpSelectPaymentMethod: unable to select payment method', 1, __FILE__, __LINE__);
            }

            // also set shipping type if not already set
            $oActiveShippingGroup = $oBasket->GetActiveShippingGroup();
            if (is_null($oActiveShippingGroup) || !$oPaymentMethod->isConnected('shop_shipping_group', $oActiveShippingGroup->id)) {
                $oMatchingShippingGroup = TdbShopShippingGroupList::GetShippingGroupsThatAllowPaymentWith($oPaymentMethod->fieldNameInternal);
                $oBasket->SetActiveShippingGroup($oMatchingShippingGroup);
                $oBasket->RecalculateBasket();
            }

            $oPaymentMethod->GetFieldShopPaymentHandler()->PostSelectPaymentHook(TCMSMessageManager::GLOBAL_CONSUMER_NAME);

            return true;
        } else {
            trigger_error('trying to access an unavailable payment method through JumpSelect', E_USER_WARNING);

            return false;
        }
    }
protected function JumpSelectPaymentMethod($sPaymentMethodId = null, $sPaymentMethodNameInternal = null)
    {
        $oPaymentMethod = null;
        if (is_null($sPaymentMethodId)) {
            $sPaymentMethodId = $this->global->GetUserData('sPaymentMethodId');
        }
        if (empty($sPaymentMethodId)) {
            $oPaymentMethod = TdbShopPaymentMethod::GetNewInstance();
            if (is_null($sPaymentMethodNameInternal)) {
                $sPaymentMethodNameInternal = $this->global->GetUserData('sPaymentMethodNameInternal');
            }
            $oPaymentMethod->LoadFromField('name_internal', $sPaymentMethodNameInternal);
        }

        if (is_null($oPaymentMethod)) {
            $oPaymentMethod = TdbShopPaymentMethod::GetNewInstance();
            $oPaymentMethod->Load($sPaymentMethodId);
        }

        if ($oPaymentMethod->IsAvailable()) {
            $oBasket = TShopBasket::GetInstance();
            $oBasket->SetActivePaymentMethod($oPaymentMethod);

            // check if payment method was set
            $oCheckPayment = $oBasket->GetActivePaymentMethod();
            if (!$oCheckPayment) {
                TTools::WriteLogEntry('JumpSelectPaymentMethod: unable to select payment method', 1, __FILE__, __LINE__);
            }

            // also set shipping type if not already set
            $oActiveShippingGroup = $oBasket->GetActiveShippingGroup();
            if (is_null($oActiveShippingGroup) || !$oPaymentMethod->isConnected('shop_shipping_group', $oActiveShippingGroup->id)) {
                $oMatchingShippingGroup = TdbShopShippingGroupList::GetShippingGroupsThatAllowPaymentWith($oPaymentMethod->fieldNameInternal);
                $oBasket->SetActiveShippingGroup($oMatchingShippingGroup);
                $oBasket->RecalculateBasket();
            }

            $oPaymentMethod->GetFieldShopPaymentHandler()->PostSelectPaymentHook(TCMSMessageManager::GLOBAL_CONSUMER_NAME);

            return true;
        } else {
            trigger_error('trying to access an unavailable payment method through JumpSelect', E_USER_WARNING);

            return false;
        }
    }
protected function JumpSelectPaymentMethod ( $ sPaymentMethodId = null , $ sPaymentMethodNameInternal = null ) { $ oPaymentMethod = null ; if ( is_null ( $ sPaymentMethodId ) ) { $ sPaymentMethodId = $ this -> global -> GetUserData ( 'sPaymentMethodId' ) ; } if ( empty ( $ sPaymentMethodId ) ) { $ oPaymentMethod = TdbShopPaymentMethod :: GetNewInstance ( ) ; if ( is_null ( $ sPaymentMethodNameInternal ) ) { $ sPaymentMethodNameInternal = $ this -> global -> GetUserData ( 'sPaymentMethodNameInternal' ) ; } $ oPaymentMethod -> LoadFromField ( 'name_internal' , $ sPaymentMethodNameInternal ) ; } if ( is_null ( $ oPaymentMethod ) ) { $ oPaymentMethod = TdbShopPaymentMethod :: GetNewInstance ( ) ; $ oPaymentMethod -> Load ( $ sPaymentMethodId ) ; } if ( $ oPaymentMethod -> IsAvailable ( ) ) { $ oBasket = TShopBasket :: GetInstance ( ) ; $ oBasket -> SetActivePaymentMethod ( $ oPaymentMethod ) ; // check if payment method was set $ oCheckPayment = $ oBasket -> GetActivePaymentMethod ( ) ; if ( ! $ oCheckPayment ) { TTools :: WriteLogEntry ( 'JumpSelectPaymentMethod: unable to select payment method' , 1 , __FILE__ , __LINE__ ) ; } // also set shipping type if not already set $ oActiveShippingGroup = $ oBasket -> GetActiveShippingGroup ( ) ; if ( is_null ( $ oActiveShippingGroup ) || ! $ oPaymentMethod -> isConnected ( 'shop_shipping_group' , $ oActiveShippingGroup -> id ) ) { $ oMatchingShippingGroup = TdbShopShippingGroupList :: GetShippingGroupsThatAllowPaymentWith ( $ oPaymentMethod -> fieldNameInternal ) ; $ oBasket -> SetActiveShippingGroup ( $ oMatchingShippingGroup ) ; $ oBasket -> RecalculateBasket ( ) ; } $ oPaymentMethod -> GetFieldShopPaymentHandler ( ) -> PostSelectPaymentHook ( TCMSMessageManager :: GLOBAL_CONSUMER_NAME ) ; return true ; } else { trigger_error ( 'trying to access an unavailable payment method through JumpSelect' , E_USER_WARNING ) ; return false ; } }
executes the post select payment hook for the given payment method. you can pass either the id
or the internal name of the payment method.

@param string $sPaymentMethodId
@param string $sPaymentMethodNameInternal
executes the post select payment hook for the given payment method . you can pass either the id or the internal name of the payment method .