title: PayPal Express Checkout always shows user "This transaction has expired." page, but no API error
body: <p>I'm trying to set up a simple payment sequence with PayPal's Express Checkout. My SetExpressCheckout call seems to work fine, I get <code>ACK=Success</code> and a token. When I redirect the user to PayPal using that token, though, it always displays a screen to them saying:</p>
  
  <blockquote>
    <p>This transaction has expired. Please return to the recipient's website
    to complete your transaction using their regular checkout flow.</p>
    
    <p>Your session has ended</p>
    
    <p>We're sorry, but your session has ended. Your account hasn't been
    charged. Please go back to the merchant's site and check out again
    with PayPal.</p>
  </blockquote>
  
  <p>Just to clarify, I don't get any error codes from the SetExpressCheckout API call, but the token always seems to be expired. I've tried redirecting to nonsense tokens, but that generates a different page. It seems that I am both receiving a valid token and redirecting to it correctly, but it has always expired in the 1-2 seconds that that takes.</p>
  
  <p>Details of an example request:</p>
  
  <p>What I'm sending in the initial SetExpressCheckout request:</p>
  
  <pre><code>Array
  (
      [PAYMENTACTION] =&gt; Sale
      [useraction] =&gt; commit
      [RETURNURL] =&gt; xxxx
      [CANCELURL] =&gt; xxxxx
      [PAYMENTREQUEST_0_AMT] =&gt; 49.00
      [PAYMENTREQUEST_0_SHIPPINGAMT] =&gt; 0
      [PAYMENTREQUEST_0_CURRENCYCODE] =&gt; USD
      [PAYMENTREQUEST_0_ITEMAMT] =&gt; 49.00
      [L_PAYMENTREQUEST_0_NAME0] =&gt; xxxxx
      [L_PAYMENTREQUEST_0_DESC0] =&gt; xxxxx
      [L_PAYMENTREQUEST_0_NUMBER0] =&gt; xxxxx
      [L_PAYMENTREQUEST_0_AMT0] =&gt; 49
      [L_PAYMENTREQUEST_0_QTY0] =&gt; 1
      [METHOD] =&gt; SetExpressCheckout
      [VERSION] =&gt; 74.0
      [USER] =&gt; xxxxx
      [PWD] =&gt; xxxxx
      [SIGNATURE] =&gt; xxxxx
  )
  </code></pre>
  
  <p>Curl_getinfo about the request:</p>
  
  <pre><code>Array
  (
      [url] =&gt; https://api-3t.sandbox.paypal.com/nvp
      [content_type] =&gt; text/plain; charset=utf-8
      [http_code] =&gt; 200
      [header_size] =&gt; 255
      [request_size] =&gt; 798
      [filetime] =&gt; -1
      [ssl_verify_result] =&gt; 0
      [redirect_count] =&gt; 0
      [total_time] =&gt; 1.139
      [namelookup_time] =&gt; 0
      [connect_time] =&gt; 0.187
      [pretransfer_time] =&gt; 0.64
      [size_upload] =&gt; 660
      [size_download] =&gt; 136
      [speed_download] =&gt; 119
      [speed_upload] =&gt; 579
      [download_content_length] =&gt; 136
      [upload_content_length] =&gt; 660
      [starttransfer_time] =&gt; 1.139
      [redirect_time] =&gt; 0
      [certinfo] =&gt; Array
          (
          )
  
      [primary_ip] =&gt; 23.4.59.42
      [primary_port] =&gt; 443
      [local_ip] =&gt; 192.168.0.102
      [local_port] =&gt; 63049
      [redirect_url] =&gt; 
  )
  </code></pre>
  
  <p>What I get back from PayPal via curl:</p>
  
  <pre><code>Array
  (
      [TOKEN] =&gt; EC-59031295261754641
      [TIMESTAMP] =&gt; 2014-01-20T10:12:27Z
      [CORRELATIONID] =&gt; 84d3d68cbd574
      [ACK] =&gt; Success
      [VERSION] =&gt; 74.0
      [BUILD] =&gt; 9285531
  )
  </code></pre>
  
  <p>I'm then redirecting the user to the relevant URL for that token (with the token <code>urlencode</code>d), in this case:</p>
  
  <pre><code>https://www.paypal.com/webscr?cmd=_express-checkout&amp;useraction=commit&amp;token=EC-59031295261754641
  </code></pre>
  
  <p>That all seems fine to me, but when I redirect to that URL, it always shows the 'transaction has expired screen'.</p>
  
  <p>Could anyone point out what I'm doing wrong?</p>