Omnipay\PayPal\Message\ExpressAuthorizeResponse::getTransactionReference PHP Method

getTransactionReference() public method

    public function getTransactionReference()
    {
        return isset($this->data['TOKEN']) ? $this->data['TOKEN'] : null;
    }

Usage Example

 public function testExpressPurchaseFailure()
 {
     $httpResponse = $this->getMockHttpResponse('ExpressPurchaseFailure.txt');
     $response = new ExpressAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody());
     $this->assertFalse($response->isSuccessful());
     $this->assertNull($response->getTransactionReference());
     $this->assertNull($response->getTransactionReference());
     $this->assertSame('This transaction cannot be processed. The amount to be charged is zero.', $response->getMessage());
 }