/** * @return HTTPConnection */ public function getHTTPConnection() { $httpConnection = new HTTPConnection(); $httpConnection->addHeader( 'X-PAYPAL-APPLICATION-ID' , $this->applicationId ); $httpConnection->addHeader( 'X-PAYPAL-REQUEST-DATA-FORMAT' , $this->requestDataFormat ); $httpConnection->addHeader( 'X-PAYPAL-RESPONSE-DATA-FORMAT' , $this->responseDataFormat ); $httpConnection->addHeader( 'X-Target-URI' , $this->targetHost ); $httpConnection->setAuthenticator( $this->authenticator ); $httpConnection->setCookieManager( new HTTPCookieManager() ); $httpConnection->initialize( $this->targetHost , true ); return $httpConnection; }