Tries to process a free payment.

@return FreePaymentManager Self object
169109
public function processPayment()
    {
        $paymentMethod = $this
            ->methodFactory
            ->create();

        /**
         * At this point, order must be created given a card, and placed in
         * PaymentBridge.
         *
         * So, $this->paymentBridge->getOrder() must return an object
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderLoad(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Order exists right here.
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderCreated(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Payment paid done.
         *
         * Paid process has ended (No matters result)
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderDone(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Payment paid successfully.
         *
         * Paid process has ended successfully
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderSuccess(
                $this->paymentBridge,
                $paymentMethod
            );

        return $this;
    }
870348
public function getPayPalPayment()
    {
        if ($this->payPalPayment === null) {
            $this->payPalPayment = false;
            $payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);

            // payment is not available/active?
            if ($payPalPayment->load("oxidpaypal") && $payPalPayment->oxpayments__oxactive->value) {
                $this->payPalPayment = $payPalPayment;
            }
        }

        return $this->payPalPayment;
    }
272869
public function process()
	{
		$view = $this->getView();

		try
		{
			// only start if there's something to do
			if( $view->param( 'ca-billing-option', null ) === null ) {
				return;
			}

			$context = $this->_getContext();
			$basketCtrl = Controller_Frontend_Factory::createController( $context, 'basket' );


			/** client/html/common/address/billing/disable-new
			 * Disables the option to enter a new billing address for an order
			 *
			 * Besides the main billing address, customers can usually enter a new
			 * billing address as well. To suppress displaying the form fields for
			 * a billing address, you can set this configuration option to "1".
			 *
			 * @param boolean A value of "1" to disable, "0" enables the billing address form
			 * @since 2014.03
			 * @category User
			 * @category Developer
			 * @see client/html/common/address/billing/salutations
			 * @see client/html/common/address/billing/mandatory
			 * @see client/html/common/address/billing/optional
			 * @see client/html/common/address/billing/hidden
			 */
			$disable = $view->config( 'client/html/common/address/billing/disable-new', false );
			$type = MShop_Order_Item_Base_Address_Abstract::TYPE_PAYMENT;

			if( ( $option = $view->param( 'ca-billing-option', 'null' ) ) === 'null' && $disable === false ) // new address
			{
				$params = $view->param( 'ca-billing', array() );
				$invalid = $this->_checkFields( $params );

				if( count( $invalid ) > 0 )
				{
					$view->billingError = $invalid;
					throw new Client_Html_Exception( sprintf( 'At least one billing address part is missing or invalid' ) );
				}

				$basketCtrl->setAddress( $type, $params );
			}
			else // existing address
			{
				$customerManager = MShop_Factory::createManager( $context, 'customer' );

				$search = $customerManager->createSearch( true );
				$expr = array(
					$search->compare( '==', 'customer.id', $option ),
					$search->getConditions(),
				);
				$search->setConditions( $search->combine( '&&', $expr ) );

				$items = $customerManager->searchItems( $search );

				if( ( $item = reset( $items ) ) === false || $option != $context->getUserId() ) {
					throw new Client_Html_Exception( sprintf( 'Customer with ID "%1$s" not found', $option ) );
				}

				$invalid = array();
				$addr = $item->getPaymentAddress();
				$params = $view->param( 'ca-billing-' . $option, array() );

				if( !empty( $params ) )
				{
					$list = array();
					$invalid = $this->_checkFields( $params );

					foreach( $params as $key => $value ) {
						$list[ str_replace( 'order.base', 'customer', $key ) ] = $value;
					}

					$addr->fromArray( $list );
					$item->setPaymentAddress( $addr );

					$customerManager->saveItem( $item );
				}

				if( count( $invalid ) > 0 )
				{
					$view->billingError = $invalid;
					throw new Client_Html_Exception( sprintf( 'At least one billing address part is missing or invalid' ) );
				}

				$basketCtrl->setAddress( $type, $addr );
			}

			parent::process();
		}
		catch( Controller_Frontend_Exception $e )
		{
			$view->billingError = $e->getErrorList();
			throw $e;
		}
	}
473442
public function processPayment(PaylandsMethod $paymentMethod)
    {
        /*
         * At this point, order must be created given a cart, and placed in PaymentBridge.
         *
         * So, $this->paymentBridge->getOrder() must return an object
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderLoad(
                $this->paymentBridge,
                $paymentMethod
            );

        /*
         * Order Not found Exception must be thrown just here.
         */
        if (!$this->paymentBridge->getOrder()) {
            throw new PaymentOrderNotFoundException();
        }

        /*
         * Order exists right here.
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderCreated(
                $this->paymentBridge,
                $paymentMethod
            );

        /*
         * Try to make the payment transaction
         */
        try {
            $this->paylandsApiAdapter->validateCard($paymentMethod);

            $this->paylandsEventDispatcher->notifyCardValid($paymentMethod);

            if (!$paymentMethod->isOnlyTokenizeCard()) {
                $this->paylandsApiAdapter->createTransaction($paymentMethod);
            }

            /*
             * Payment paid done.
             *
             * Paid process has ended ( No matters result )
             */
            $this
                ->paymentEventDispatcher
                ->notifyPaymentOrderDone(
                    $this->paymentBridge,
                    $paymentMethod
                );

            if (PaylandsMethod::STATUS_OK !== $paymentMethod->getPaymentStatus()) {
                throw new PaymentException(sprintf('Order %s could not be paid',
                    $paymentMethod->getPaymentResult()['order']['uuid']
                ));
            }

            /*
             * Payment paid successfully.
             *
             * Paid process has ended successfully
             */
            $this
                ->paymentEventDispatcher
                ->notifyPaymentOrderSuccess(
                    $this->paymentBridge,
                    $paymentMethod
                );
        } catch (PaymentException $e) {
            /*
             * Payment paid failed.
             *
             * Paid process has ended failed
             */
            $this
                ->paymentEventDispatcher
                ->notifyPaymentOrderFail(
                    $this->paymentBridge,
                    $paymentMethod
                );

            throw $e;
        }

        return $this;
    }
474784
public function create()
    {
        $instance = self::createPaymentToken($this);
        $this->setId($instance->getId());
        return $instance;
    }
617281
public function process()
    {
        $this->reauthorize();

        $handler = $this->getHandler();

        $response = $handler->getPayPalResponse();
        $data = $handler->getData();

        $this->updateOrder($response, $data);

        $payment = $this->createPayment($response);
        $paymentList = $this->getOrder()->getPaymentList();
        $payment = $paymentList->addPayment($payment);

        $this->addComment($payment, $data->getComment());
    }
3888
public function paymentSuccessful() {
    if ($this->requestHasSucceeded() && $this->requestMethod->isDirectPayment()) {
      return $this->requestMethod->getTransactionSuccessfulCode() == $this->response['resultPayment'];
    }

    return false;
  }
871212
public function getPayment()
    {
        if (is_null($this->payment)) {
            $payPalPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
            $payPalPayment->load('oxidpaypal');
            $this->setPayment($payPalPayment);
        }

        return $this->payment;
    }
240428
public function getPayment()
    {
        if ($this->_oPayment === null) {
            $this->_oPayment = false;

            $oBasket = $this->getBasket();
            $oUser = $this->getUser();

            // payment is set ?
            $sPaymentid = $oBasket->getPaymentId();
            $oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);

            if ($sPaymentid && $oPayment->load($sPaymentid) &&
                $oPayment->isValidPayment(
                    \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('dynvalue'),
                    \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(),
                    $oUser,
                    $oBasket->getPriceForPayment(),
                    \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('sShipSet')
                )
            ) {
                $this->_oPayment = $oPayment;
            }
        }

        return $this->_oPayment;
    }
59998
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oURLData = &TCMSSmartURLData::GetActive();
            // If 3D-Secure Authentification fails, the ECI value is empty
            if (!empty($oURLData->aParameters['eci']) && !empty($oURLData->aParameters['xid'])) {
                $_SESSION['3ds_payment']['eci'] = $oURLData->aParameters['eci'];
                $_SESSION['3ds_payment']['xid'] = $oURLData->aParameters['xid'];
                $_SESSION['3ds_payment']['cavv'] = $oURLData->aParameters['cavv'];
                $bPaymentTransmitOk = true;
            } else {
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(self::MSG_MANAGER_NAME, 'ERROR-ORDER-RESPONSE-PAYMENTONE-ERROR', array('errorMsg' => TGlobal::Translate('chameleon_system_shop.payment_payone.error_user_abort')));
                $bPaymentTransmitOk = false;
            }
        }

        return $bPaymentTransmitOk;
    }
630050
protected function userPayment()
	{
		$this->refId = Input::get('RefId');
		$this->trackingCode = Input::get('SaleReferenceId');
		$this->cardNumber = Input::get('CardHolderPan');
		$payRequestResCode = Input::get('ResCode');

		if ($payRequestResCode == '0') {
			return true;
		}

		$this->transactionFailed();
		$this->newLog($payRequestResCode, @MellatException::$errors[$payRequestResCode]);
		throw new MellatException($payRequestResCode);
	}
47267
protected function ProcessStep()
    {
        $continue = parent::ProcessStep();

        $basket = $this->getShopService()->getActiveBasket();
        /**
         * If the user managed to submit the confirmation form twice, we need to avoid handling the second submit.
         * The parent's ProcessStep() method will have delayed the second click until the first request is processed
         * completely by locking the session, so that we can check if the order has already been completed.
         * If yes, we simply forward to the next step (most likely the thank-you page).
         */
        if (0 === $basket->dTotalNumberOfArticles && TdbShopOrderStep::OrderProcessHasBeenMarkedAsCompleted()) {
            $this->JumpToStep($this->GetNextStep());
        }

        // check AGB
        $input = $this->getInputFilterUtil()->getFilteredPostInput('aInput');
        if (false === is_array($input)) {
            $input = array();
        }
        $agb = 'false';
        if (array_key_exists('agb', $input)) {
            $agb = $input['agb'];
        }
        if ('true' !== $agb) {
            $this->getFlashMessages()->addMessage(MTShopBasketCore::MSG_CONSUMER_NAME.'-agb', 'ERROR-CONFIRM-AGB');
            $continue = false;
        }

        $user = $this->getExtranetUserProvider()->getActiveUser();
        $continue = $basket->GetActivePaymentMethod()->processConfirmOrderUserResponse($user, $input) && $continue;

        if ($continue) {
            $this->addDataToBasket($basket);
            // if we fail here, we need to jump back to the current step so any data is rechecked
            if (false === $basket->CreateOrder(MTShopBasketCore::MSG_CONSUMER_NAME)) {
                $this->JumpToStep($this);
            } else {
                $this->PostProcessHookOnOrderCreateSuccess();
            }
        }

        return $continue;
    }
219198
public function isUserPaymentPaymorrowMethod()
    {
        $sPaymentId = $this->oxuserpayments__oxpaymentsid->value;

        /** @var OxpsPaymorrowOxPayment|oxPayment $oxPayment */
        $oxPayment = oxNew( 'oxPayment' );
        $oxPayment->load( $sPaymentId );

        return $oxPayment->isPaymorrowActiveAndMapped();
    }
371097
public function begin() {
        if($this->isInTransaction()) {
            throw new \Exception('You cannot start a new transaction once you are already in one (Originally started at: ' . self::$stackTrace . ')');
        } else {
            $e = new \Exception();
            self::$stackTrace = $e->getTraceAsString();
        }
        $transactionManager = new TransactionManager();
        $transactionManager->setDbService($this->getDbService());
        $this->setTransaction($transactionManager->get());
    }
546788
protected function ProcessStep()
    {
        $bContinue = parent::ProcessStep();
        $oMsgManager = TCMSMessageManager::GetInstance();

        // we may continue only if a shipping group and payment method is set
        if ($bContinue && is_null($this->oActiveShippingGroup)) {
            $oMsgManager->AddMessage(self::MSG_SHIPPING_GROUP, 'ERROR-BASKET-NO-SHIPPING-GROUP');
            $bContinue = false;
        }
        if ($bContinue && is_null($this->oActivePaymentMethod)) {
            $oMsgManager->AddMessage(self::MSG_PAYMENT_METHOD, 'ERROR-BASKET-NO-PAYMENT-METHOD');
            $bContinue = false;
        }

        $oPaymentHandler = null;
        if ($bContinue) {
            // check payment method data
            $oPaymentHandler = &$this->oActivePaymentMethod->GetFieldShopPaymentHandler();
            $bContinue = $oPaymentHandler->ValidateUserInput();
        }

        if ($bContinue) {
            // set payment method and shipping group in basket
            $oBasket = TShopBasket::GetInstance();
            $oBasket->SetActiveShippingGroup($this->oActiveShippingGroup);
            $oBasket->SetActivePaymentMethod($this->oActivePaymentMethod);
            $oBasket->RecalculateBasket();
            $bContinue = $this->postSelectPaymentHook();

            // if things fail here, we need to redirect to the active step to clear our parameter list - and refresh the payment list
            if (false === $bContinue) {
                $this->JumpToStep($this);
            }
        }

        return $bContinue;
    }
41969
public function getPaymorrowOxPayment()
    {
        $sPaymentId = $this->oxuserpayments__oxpaymentsid->value;

        $oPayment = oxNew( 'oxPayment' );
        $oPayment->load( $sPaymentId );

        return $oPayment;
    }
212482
private function getPaymentDataHelper() {
        if ($this->paymentDataHelper === null) {
            $this->paymentDataHelper = ObjectManager::getInstance()->get(Data::class);
        }
        return $this->paymentDataHelper;
    }