title: PayPal error. This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow
body: <p>I'm trying to implement PayPal Direct payement to my website.</p>
  
  <p>I get a Succes token back from PayPal when making a SetExpressCheckout call:</p>
  
  <pre><code>Array
  (
      [TIMESTAMP] =&gt; 2015-03-06T10:16:55Z
      [CORRELATIONID] =&gt; 7d0a42f74fa6b
      [ACK] =&gt; Success
      [VERSION] =&gt; 121
      [BUILD] =&gt; 15420584
      [AMT] =&gt; 125.00
      [CURRENCYCODE] =&gt; EUR
      [AVSCODE] =&gt; X
      [CVV2MATCH] =&gt; M
      [TRANSACTIONID] =&gt; 29A40018PU668530B
  )
  </code></pre>
  
  <p><strong>The Response looks like this:</strong></p>
  
  <p>TIMESTAMP=2015%2d03%2d06T10%3a16%3a55Z&amp;CORRELATIONID=7d0a42f74fa6b&amp;ACK=Success&amp;VERSION=121&amp;BUILD=15420584&amp;AMT=125%2e00&amp;CURRENCYCODE=EUR&amp;AVSCODE=X&amp;CVV2MATCH=M&amp;TRANSACTIONID=29A40018PU668530B</p>
  
  <p>I've tried to depercent the url in several ways to send the response back top paypal. What I'm using now is: </p>
  
  <pre><code>$result = rawurldecode($result);
  </code></pre>
  
  <p><strong>The result looks like this as depercented:</strong> 
  TIMESTAMP=2015-03-06T10:16:55Z&amp;CORRELATIONID=7d0a42f74fa6b&amp;ACK=Success&amp;VERSION=121&amp;BUILD=15420584&amp;AMT=125.00&amp;CURRENCYCODE=EUR&amp;AVSCODE=X&amp;CVV2MATCH=M&amp;TRANSACTIONID=29A40018PU668530B</p>
  
  <p>I've tried to lovercase the request with strtolower the result became like this:</p>
  
  <p><strong>Lowercased result:</strong></p>
  
  <p>timestamp=2015-03-06t10:31:45z&amp;correlationid=490f48424be02&amp;ack=success&amp;version=121&amp;build=15420584&amp;amt=125.00¤cycode=eur&amp;avscode=x&amp;cvv2match=m&amp;transactionid=80g4320670816912n</p>
  
  <p>I've realised that strange character before cycode: ¤</p>
  
  <p>When i try to send back the token with a redirect from PHP like this, (with or without the lowercased):</p>
  
  <pre><code>header('Location: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&amp;'.$result);
  </code></pre>
  
  <p>I get redirected to:
  <a href="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_flow&amp;SESSION=" rel="nofollow">https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_flow&amp;SESSION=</a>...</p>
  
  <p>Saying:</p>
  
  <blockquote>
    <p>This transaction is invalid. Please return to the recipient's website
    to complete your transaction using their regular checkout flow. Return
    to merchant At this time, we are unable to process your request.
    Please return to and try another option. Test Site</p>
  </blockquote>
  
  <p>Even when I'm using the not lowercased version I got the same error!</p>
  
  <p>I've realized that localhost was a problem. When uploaded my site the SetExpressCheckout Token was fine.</p>
  
  <p>The problem is now when i'm getting back this token:
  TOKEN=EC%2d0PA6125744246545G&amp;TIMESTAMP=2015%2d03%2d06T13%3a10%3a09Z&amp;CORRELATIONID=10c7929423b68&amp;ACK=Success&amp;VERSION=121&amp;BUILD=15640276</p>
  
  <p>And sending a GetExpressCheckoutDetails request, with these parameters:</p>
  
  <pre><code>Array
  (
      [METHOD] =&gt; GetExpressCheckoutDetails
      [USER] =&gt; ...
      [PWD] =&gt; ...
      [SIGNATURE] =&gt; ...
      [VERSION] =&gt; 121
      [TOKEN] =&gt; TOKEN=EC-0PA6125744246545G&amp;TIMESTAMP=2015-03-06T13:10:09Z&amp;CORRELATIONID=10c7929423b68&amp;ACK=Success&amp;VERSION=121&amp;BUILD=15640276
  )
  </code></pre>
  
  <p>I still get a Token error: </p>
  
  <pre><code>Array
  (
      [TIMESTAMP] =&gt; 2015-03-06T13:10:10Z
      [CORRELATIONID] =&gt; 4ec125d8280f3
      [ACK] =&gt; Failure
      [VERSION] =&gt; 121
      [BUILD] =&gt; 15640276
      [L_ERRORCODE0] =&gt; 10410
      [L_SHORTMESSAGE0] =&gt; Invalid token
      [L_LONGMESSAGE0] =&gt; Invalid token.
      [L_SEVERITYCODE0] =&gt; Error
  )
  </code></pre>
  
  <p>Thank you for helping me out on this!</p>