protected function _doExpressCheckoutPayment( $additional )
	{
		$orderManager = MShop_Factory::createManager( $this->_getContext(), 'order' );
		$orderBaseManager = MShop_Factory::createManager( $this->_getContext(), 'order/base' );

		$order = $orderManager->getItem( $additional['orderid'] );
		$baseid = $order->getBaseId();
		$baseItem = $orderBaseManager->getItem( $baseid );
		$serviceItem = $this->_getOrderServiceItem( $baseid );

		$values = $this->_getAuthParameter();
		$values['METHOD'] = 'DoExpressCheckoutPayment';
		$values['TOKEN'] = $additional['token'];
		$values['PAYERID'] = $additional['PayerID'];
		$values['PAYMENTACTION'] = $this->_getConfigValue( array( 'paypalexpress.PaymentAction' ), 'Sale' );
		$values['CURRENCYCODE'] = $baseItem->getPrice()->getCurrencyId();
		$values['NOTIFYURL'] = $this->_getConfigValue( array( 'payment.url-update', 'payment.url-success' ) );
		$values['AMT'] = ( $baseItem->getPrice()->getValue() + $baseItem->getPrice()->getCosts() );

		$urlQuery = http_build_query( $values, '', '&' );
		$response = $this->_getCommunication()->transmit( $this->_apiendpoint, 'POST', $urlQuery );
		$rvals = $this->_checkResponse( $order->getId(), $response, __METHOD__ );

		$attributes = array( 'PAYERID' => $additional['PayerID'] );

		if( isset( $rvals['TRANSACTIONID'] ) ) {
			$attributes['TRANSACTIONID'] = $rvals['TRANSACTIONID'];
			$this->_saveAttributes( array( $rvals['TRANSACTIONID'] => $rvals['PAYMENTSTATUS'] ), $serviceItem, 'payment/paypal/txn' );
		}

		$this->_saveAttributes( $attributes, $serviceItem );
		$this->_setPaymentStatus( $order, $rvals );
		$orderManager->saveItem( $order );

		return $order;
	}
protected function _doExpressCheckoutPayment( $additional )
	{
		$orderManager = MShop_Factory::createManager( $this->_getContext(), 'order' );
		$orderBaseManager = MShop_Factory::createManager( $this->_getContext(), 'order/base' );

		$order = $orderManager->getItem( $additional['orderid'] );
		$baseid = $order->getBaseId();
		$baseItem = $orderBaseManager->getItem( $baseid );
		$serviceItem = $this->_getOrderServiceItem( $baseid );

		$values = $this->_getAuthParameter();
		$values['METHOD'] = 'DoExpressCheckoutPayment';
		$values['TOKEN'] = $additional['token'];
		$values['PAYERID'] = $additional['PayerID'];
		$values['PAYMENTACTION'] = $this->_getConfigValue( array( 'paypalexpress.PaymentAction' ), 'Sale' );
		$values['CURRENCYCODE'] = $baseItem->getPrice()->getCurrencyId();
		$values['NOTIFYURL'] = $this->_getConfigValue( array( 'payment.url-update', 'payment.url-success' ) );
		$values['AMT'] = ( $baseItem->getPrice()->getValue() + $baseItem->getPrice()->getCosts() );

		$urlQuery = http_build_query( $values, '', '&' );
		$response = $this->_getCommunication()->transmit( $this->_apiendpoint, 'POST', $urlQuery );
		$rvals = $this->_checkResponse( $order->getId(), $response, __METHOD__ );

		$attributes = array( 'PAYERID' => $additional['PayerID'] );

		if( isset( $rvals['TRANSACTIONID'] ) ) {
			$attributes['TRANSACTIONID'] = $rvals['TRANSACTIONID'];
			$this->_saveAttributes( array( $rvals['TRANSACTIONID'] => $rvals['PAYMENTSTATUS'] ), $serviceItem, 'payment/paypal/txn' );
		}

		$this->_saveAttributes( $attributes, $serviceItem );
		$this->_setPaymentStatus( $order, $rvals );
		$orderManager->saveItem( $order );

		return $order;
	}
protected function _doExpressCheckoutPayment ( $ additional ) { $ orderManager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'order' ) ; $ orderBaseManager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'order/base' ) ; $ order = $ orderManager -> getItem ( $ additional [ 'orderid' ] ) ; $ baseid = $ order -> getBaseId ( ) ; $ baseItem = $ orderBaseManager -> getItem ( $ baseid ) ; $ serviceItem = $ this -> _getOrderServiceItem ( $ baseid ) ; $ values = $ this -> _getAuthParameter ( ) ; $ values [ 'METHOD' ] = 'DoExpressCheckoutPayment' ; $ values [ 'TOKEN' ] = $ additional [ 'token' ] ; $ values [ 'PAYERID' ] = $ additional [ 'PayerID' ] ; $ values [ 'PAYMENTACTION' ] = $ this -> _getConfigValue ( array ( 'paypalexpress.PaymentAction' ) , 'Sale' ) ; $ values [ 'CURRENCYCODE' ] = $ baseItem -> getPrice ( ) -> getCurrencyId ( ) ; $ values [ 'NOTIFYURL' ] = $ this -> _getConfigValue ( array ( 'payment.url-update' , 'payment.url-success' ) ) ; $ values [ 'AMT' ] = ( $ baseItem -> getPrice ( ) -> getValue ( ) + $ baseItem -> getPrice ( ) -> getCosts ( ) ) ; $ urlQuery = http_build_query ( $ values , '' , '&' ) ; $ response = $ this -> _getCommunication ( ) -> transmit ( $ this -> _apiendpoint , 'POST' , $ urlQuery ) ; $ rvals = $ this -> _checkResponse ( $ order -> getId ( ) , $ response , __METHOD__ ) ; $ attributes = array ( 'PAYERID' => $ additional [ 'PayerID' ] ) ; if ( isset ( $ rvals [ 'TRANSACTIONID' ] ) ) { $ attributes [ 'TRANSACTIONID' ] = $ rvals [ 'TRANSACTIONID' ] ; $ this -> _saveAttributes ( array ( $ rvals [ 'TRANSACTIONID' ] => $ rvals [ 'PAYMENTSTATUS' ] ) , $ serviceItem , 'payment/paypal/txn' ) ; } $ this -> _saveAttributes ( $ attributes , $ serviceItem ) ; $ this -> _setPaymentStatus ( $ order , $ rvals ) ; $ orderManager -> saveItem ( $ order ) ; return $ order ; }
Begins paypalexpress transaction and saves transaction id.

@param mixed $additional Update information whose format depends on the payment provider
@return MShop_Order_Item_Interface|null Order item if update was successful, null if the given parameters are not valid for this provider
Begins paypalexpress transaction and saves transaction id .