title: Authorization Failed [Omnipay and Paypal]
body: <p>Authorization Failed</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$gateway = Omnipay::create('PayPal_Express');
  
          // Initialise the gateway
          $gateway-&gt;initialize(array(
              'clientId' =&gt; 'AZzCeImpURKHH0LIFSBTrEWGY-NKLCnUUQdHT049pRLvwBXg9BnlpbnsiGLPFQH43DU4eL-Qi96nrZU6',
              'secret' =&gt; 'EFP_mny9dfaaAfW1oyNM8R05weA5eIkU51KUSAdbvcoh3v4bo7txRBm-uzDZ2nOlZ0KmqS-JalgujFok',
              'testMode' =&gt; true, // Or false when you are ready for live transactions
          ));
  
          // Do an authorisation transaction on the gateway
          $transaction = $gateway-&gt;authorize(array(
              'returnUrl' =&gt; 'http://client.com',
              'cancelUrl' =&gt; 'http://localhost:8000/cancel',
              'amount' =&gt; '10.00',
              'currency' =&gt; 'AUD',
              'description' =&gt; 'This is a test authorize transaction.',
                  // 'card'          =&gt; $card,
          ));
  
          $response = $transaction-&gt;send();
          if ($response-&gt;isSuccessful()) {
              // Find the authorization ID
              $authResponse = $response-&gt;getTransactionReference();
              echo "Authorize transaction was successful!\n" . $authResponse;
          } else {
              echo "Failed to auth transaction";
              dd($response);
          }
  
          // Once the transaction has been approved, we need to complete it.
          $transaction = $gateway-&gt;completePurchase(array(
              'payerId' =&gt; $request-&gt;PayerID,
              'transactionReference' =&gt; $authResponse
          ));
  
          $finalResponse = $transaction-&gt;send();
  
          dd($finalResponse);
  
          if ($finalResponse-&gt;getData()) {
              echo "Transaction was successful!\n";
              // Find the authorization ID
              $results = $finalResponse-&gt;getTransactionReference();
              dd($results);
          } else {
              dd($finalResponse-&gt;getData());
          }
  </code></pre>
  
  <p>I am trying to set up paypal sendbox with my laravel app. This code is in get method and when I call it I get:</p>
  
  <pre><code>Failed to auth transaction
  ExpressAuthorizeResponse {#354 ▼
    #liveCheckoutEndpoint: "https://www.paypal.com/cgi-bin/webscr"
    #testCheckoutEndpoint: "https://www.sandbox.paypal.com/cgi-bin/webscr"
    #request: ExpressAuthorizeRequest {#349 ▶}
    #data: array:9 [▼
      "TIMESTAMP" =&gt; "2016-02-12T15:06:21Z"
      "CORRELATIONID" =&gt; "68efe51d8aca6"
      "ACK" =&gt; "Failure"
      "VERSION" =&gt; "119.0"
      "BUILD" =&gt; "18308778"
      "L_ERRORCODE0" =&gt; "10002"
      "L_SHORTMESSAGE0" =&gt; "Authentication/Authorization Failed"
      "L_LONGMESSAGE0" =&gt; "You do not have permissions to make this API call"
      "L_SEVERITYCODE0" =&gt; "Error"
    ]
  }
  </code></pre>
  
  <p>Anyone know what is problem? Thanks</p>