lib/custom/src/MShop/Service/Provider/Payment/OmniPay.php
protected function processOrder( \Aimeos\MShop\Order\Item\Iface $order, array $params = [] )
	{
		$parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_SERVICE
			| \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT
			| \Aimeos\MShop\Order\Item\Base\Base::PARTS_ADDRESS;

		$base = $this->getOrderBase( $order->getBaseId(), $parts );
		$data = $this->getData( $base, $order->getId(), $params );
		$urls = $this->getPaymentUrls();

		try
		{
			$provider = $this->getProvider();

			if( $this->getValue( 'authorize', false ) && $provider->supportsAuthorize() )
			{
				$response = $provider->authorize( $data )->send();
				$status = \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED;
			}
			else
			{
				$response = $provider->purchase( $data )->send();
				$status = \Aimeos\MShop\Order\Item\Base::PAY_RECEIVED;
			}

			if( $response->isSuccessful() )
			{
				$this->saveTransationRef( $base, $response->getTransactionReference() );

				$order->setPaymentStatus( $status );
				$this->saveOrder( $order );
			}
			elseif( $response->isRedirect() )
			{
				if( ( $ref = $response->getTransactionReference() ) != null ) {
					$this->saveTransationRef( $base, $ref );
				}

				return $this->getRedirectForm( $response );
			}
			else
			{
				$order->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_REFUSED );
				$this->saveOrder( $order );

				throw new \Aimeos\MShop\Service\Exception( $response->getMessage() );
			}
		}
		catch( \Exception $e )
		{
			throw new \Aimeos\MShop\Service\Exception( $e->getMessage() );
		}

		return new \Aimeos\MShop\Common\Helper\Form\Standard( $urls['returnUrl'], 'POST', [] );
	}
protected function processOrder( \Aimeos\MShop\Order\Item\Iface $order, array $params = [] )
	{
		$parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_SERVICE
			| \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT
			| \Aimeos\MShop\Order\Item\Base\Base::PARTS_ADDRESS;

		$base = $this->getOrderBase( $order->getBaseId(), $parts );
		$data = $this->getData( $base, $order->getId(), $params );
		$urls = $this->getPaymentUrls();

		try
		{
			$provider = $this->getProvider();

			if( $this->getValue( 'authorize', false ) && $provider->supportsAuthorize() )
			{
				$response = $provider->authorize( $data )->send();
				$status = \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED;
			}
			else
			{
				$response = $provider->purchase( $data )->send();
				$status = \Aimeos\MShop\Order\Item\Base::PAY_RECEIVED;
			}

			if( $response->isSuccessful() )
			{
				$this->saveTransationRef( $base, $response->getTransactionReference() );

				$order->setPaymentStatus( $status );
				$this->saveOrder( $order );
			}
			elseif( $response->isRedirect() )
			{
				if( ( $ref = $response->getTransactionReference() ) != null ) {
					$this->saveTransationRef( $base, $ref );
				}

				return $this->getRedirectForm( $response );
			}
			else
			{
				$order->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_REFUSED );
				$this->saveOrder( $order );

				throw new \Aimeos\MShop\Service\Exception( $response->getMessage() );
			}
		}
		catch( \Exception $e )
		{
			throw new \Aimeos\MShop\Service\Exception( $e->getMessage() );
		}

		return new \Aimeos\MShop\Common\Helper\Form\Standard( $urls['returnUrl'], 'POST', [] );
	}
protected function processOrder ( \ Aimeos \ MShop \ Order \ Item \ Iface $ order , array $ params = [ ] ) { $ parts = \ Aimeos \ MShop \ Order \ Item \ Base \ Base :: PARTS_SERVICE | \ Aimeos \ MShop \ Order \ Item \ Base \ Base :: PARTS_PRODUCT | \ Aimeos \ MShop \ Order \ Item \ Base \ Base :: PARTS_ADDRESS ; $ base = $ this -> getOrderBase ( $ order -> getBaseId ( ) , $ parts ) ; $ data = $ this -> getData ( $ base , $ order -> getId ( ) , $ params ) ; $ urls = $ this -> getPaymentUrls ( ) ; try { $ provider = $ this -> getProvider ( ) ; if ( $ this -> getValue ( 'authorize' , false ) && $ provider -> supportsAuthorize ( ) ) { $ response = $ provider -> authorize ( $ data ) -> send ( ) ; $ status = \ Aimeos \ MShop \ Order \ Item \ Base :: PAY_AUTHORIZED ; } else { $ response = $ provider -> purchase ( $ data ) -> send ( ) ; $ status = \ Aimeos \ MShop \ Order \ Item \ Base :: PAY_RECEIVED ; } if ( $ response -> isSuccessful ( ) ) { $ this -> saveTransationRef ( $ base , $ response -> getTransactionReference ( ) ) ; $ order -> setPaymentStatus ( $ status ) ; $ this -> saveOrder ( $ order ) ; } elseif ( $ response -> isRedirect ( ) ) { if ( ( $ ref = $ response -> getTransactionReference ( ) ) != null ) { $ this -> saveTransationRef ( $ base , $ ref ) ; } return $ this -> getRedirectForm ( $ response ) ; } else { $ order -> setPaymentStatus ( \ Aimeos \ MShop \ Order \ Item \ Base :: PAY_REFUSED ) ; $ this -> saveOrder ( $ order ) ; throw new \ Aimeos \ MShop \ Service \ Exception ( $ response -> getMessage ( ) ) ; } } catch ( \ Exception $ e ) { throw new \ Aimeos \ MShop \ Service \ Exception ( $ e -> getMessage ( ) ) ; } return new \ Aimeos \ MShop \ Common \ Helper \ Form \ Standard ( $ urls [ 'returnUrl' ] , 'POST' , [ ] ) ; }
Tries to get an authorization or captures the money immediately for the given order if capturing the money
separately isn't supported or not configured by the shop owner.

@param \Aimeos\MShop\Order\Item\Iface $order Order invoice object
@param array $params Request parameter if available
@return \Aimeos\MShop\Common\Helper\Form\Standard Form object with URL, action and parameters to redirect to
(e.g. to an external server of the payment provider or to a local success page)
Tries to get an authorization or captures the money immediately for the given order if capturing the money separately isn t supported or not configured by the shop owner .