public function capture( MShop_Order_Item_Interface $order )
	{
		$orderManager = MShop_Factory::createManager( $this->_getContext(), 'order' );
		$orderBaseManager = MShop_Factory::createManager( $this->_getContext(), 'order/base' );

		$baseid = $order->getBaseId();
		$baseItem = $orderBaseManager->getItem( $baseid );
		$serviceItem = $this->_getOrderServiceItem( $baseid );

		if( ( $tid = $serviceItem->getAttribute('TRANSACTIONID') ) === null )
		{
			$msg = sprintf( 'PayPal Express: Payment transaction ID for order ID "%1$s" not available', $order->getId() );
			throw new MShop_Service_Exception( $msg );
		}

		$values = $this->_getAuthParameter();
		$values['METHOD'] = 'DoCapture';
		$values['COMPLETETYPE'] = 'Complete';
		$values['AUTHORIZATIONID'] = $tid;
		$values['INVNUM'] = $order->getId();
		$values['CURRENCYCODE'] = $baseItem->getPrice()->getCurrencyId();
		$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__ );

		$this->_setPaymentStatus( $order, $rvals );

		$attributes = array();
		if( isset( $rvals['PARENTTRANSACTIONID'] ) ) {
			$attributes['PARENTTRANSACTIONID'] = $rvals['PARENTTRANSACTIONID'];
		}

		//updates the transaction id
		$attributes['TRANSACTIONID'] = $rvals['TRANSACTIONID'];
		$this->_saveAttributes( $attributes, $serviceItem );

		$orderManager->saveItem( $order );
	}
public function capture( MShop_Order_Item_Interface $order )
	{
		$orderManager = MShop_Factory::createManager( $this->_getContext(), 'order' );
		$orderBaseManager = MShop_Factory::createManager( $this->_getContext(), 'order/base' );

		$baseid = $order->getBaseId();
		$baseItem = $orderBaseManager->getItem( $baseid );
		$serviceItem = $this->_getOrderServiceItem( $baseid );

		if( ( $tid = $serviceItem->getAttribute('TRANSACTIONID') ) === null )
		{
			$msg = sprintf( 'PayPal Express: Payment transaction ID for order ID "%1$s" not available', $order->getId() );
			throw new MShop_Service_Exception( $msg );
		}

		$values = $this->_getAuthParameter();
		$values['METHOD'] = 'DoCapture';
		$values['COMPLETETYPE'] = 'Complete';
		$values['AUTHORIZATIONID'] = $tid;
		$values['INVNUM'] = $order->getId();
		$values['CURRENCYCODE'] = $baseItem->getPrice()->getCurrencyId();
		$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__ );

		$this->_setPaymentStatus( $order, $rvals );

		$attributes = array();
		if( isset( $rvals['PARENTTRANSACTIONID'] ) ) {
			$attributes['PARENTTRANSACTIONID'] = $rvals['PARENTTRANSACTIONID'];
		}

		//updates the transaction id
		$attributes['TRANSACTIONID'] = $rvals['TRANSACTIONID'];
		$this->_saveAttributes( $attributes, $serviceItem );

		$orderManager->saveItem( $order );
	}
public function capture ( MShop_Order_Item_Interface $ order ) { $ orderManager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'order' ) ; $ orderBaseManager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'order/base' ) ; $ baseid = $ order -> getBaseId ( ) ; $ baseItem = $ orderBaseManager -> getItem ( $ baseid ) ; $ serviceItem = $ this -> _getOrderServiceItem ( $ baseid ) ; if ( ( $ tid = $ serviceItem -> getAttribute ( 'TRANSACTIONID' ) ) === null ) { $ msg = sprintf ( 'PayPal Express: Payment transaction ID for order ID "%1$s" not available' , $ order -> getId ( ) ) ; throw new MShop_Service_Exception ( $ msg ) ; } $ values = $ this -> _getAuthParameter ( ) ; $ values [ 'METHOD' ] = 'DoCapture' ; $ values [ 'COMPLETETYPE' ] = 'Complete' ; $ values [ 'AUTHORIZATIONID' ] = $ tid ; $ values [ 'INVNUM' ] = $ order -> getId ( ) ; $ values [ 'CURRENCYCODE' ] = $ baseItem -> getPrice ( ) -> getCurrencyId ( ) ; $ 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__ ) ; $ this -> _setPaymentStatus ( $ order , $ rvals ) ; $ attributes = array ( ) ; if ( isset ( $ rvals [ 'PARENTTRANSACTIONID' ] ) ) { $ attributes [ 'PARENTTRANSACTIONID' ] = $ rvals [ 'PARENTTRANSACTIONID' ] ; } //updates the transaction id $ attributes [ 'TRANSACTIONID' ] = $ rvals [ 'TRANSACTIONID' ] ; $ this -> _saveAttributes ( $ attributes , $ serviceItem ) ; $ orderManager -> saveItem ( $ order ) ; }
Captures the money later on request for the given order if supported.

@param MShop_Order_Item_Interface $order Order invoice object
Captures the money later on request for the given order if supported .