Answers.Body: <p>The Craft support helped me to figure this out. The problem was, that the CSRF wasn't properly disabled.</p>
  
  <p>So in my config/general.php I have the following:</p>
  
  <pre><code>if ( !function_exists('isApiRequest') ) {
      function isApiRequest ()
      {
          $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
          $query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
  
          $actions = [
              'actions/charge/webhook/callback',
              'actions/commerce/payments/complete-payment',
  
          ];
  
          foreach ($actions as $action) {
              if ( strpos($path, $action) || strpos($query, $action) ) {
                  return true;
              }
          }
  
          return false;
      }
  }
  
  return [
  
  '*' =&gt; [
  
      'enableCsrfProtection' =&gt; !isApiRequest(),
      ...
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-25T10:56:26.910Z
Answers.Text: Thank you! Seems 'complete-payment' got renamed from 'completePayment' which is why the code from another post didn't work for me.
Answers.UserDisplayName: portnull
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-10T16:31:06.963Z
Answers.LastActivityDate: 2018-09-10T16:31:06.963Z
Answers.UserDisplayName: obs
Body: <p>I try to get PayPal Express running but have quite some difficulties. 
  I use the default templates for testing and can get through the whole checkout and payment process, but then PayPal closes and in the console I see the following</p>
  
  <pre><code>http.js:114 PaypalUncaught Error: Request to post http://xxx.local/index.php?p=actions/commerce/payments/complete-payment&amp;commerceTransactionHash=xxx&amp;token=xxx&amp;PayerID=xxx failed with 400 error. 
  Correlation id: unknown   
  {"error": "Es ist nicht möglich, Ihre Dateneingabe zu prüfen."}
  </code></pre>
  
  <p>The error message can be translated to: It's not possible to check your data input.</p>
  
  <p>In my Craft config, I changed the token name, as described here: <a href="https://github.com/craftcms/commerce-paypal" rel="nofollow noreferrer">https://github.com/craftcms/commerce-paypal</a></p>
  
  <p>Any ideas what the reason for this could be?</p>
  
Tags: <plugin-craftcommerce2><payment>
Title: Craft Commerce 2: PayPal Express not working - Correlation id: unknown
ThreadText: # Craft Commerce 2: PayPal Express not working - Correlation id: unknown
  
  (Asked by: username_0 on 2018-08-28)
  
  I try to get PayPal Express running but have quite some difficulties.
  I use the default templates for testing and can get through the whole checkout and payment process, but then PayPal closes and in the console I see the following
  
  ```
  http.js:114 PaypalUncaught Error: Request to post http://xxx.local/index.php?p=actions/commerce/payments/complete-payment&commerceTransactionHash=xxx&token=xxx&PayerID=xxx failed with 400 error. 
  Correlation id: unknown   
  {"error": "Es ist nicht möglich, Ihre Dateneingabe zu prüfen."}
  
  ```
  
  The error message can be translated to: It's not possible to check your data input.
  
  In my Craft config, I changed the token name, as described here: <https://github.com/craftcms/commerce-paypal>
  
  Any ideas what the reason for this could be?
  
  **Tags:** plugin-craftcommerce2, payment
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-09-10. Score: 2
  
  The Craft support helped me to figure this out. The problem was, that the CSRF wasn't properly disabled.
  
  So in my config/general.php I have the following:
  
  ```
  if ( !function_exists('isApiRequest') ) {
      function isApiRequest ()
      {
          $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
          $query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
  
          $actions = [
              'actions/charge/webhook/callback',
              'actions/commerce/payments/complete-payment',
  
          ];
  
          foreach ($actions as $action) {
              if ( strpos($path, $action) || strpos($query, $action) ) {
                  return true;
              }
          }
  
          return false;
      }
  }
  
  return [
  
  '*' => [
  
      'enableCsrfProtection' => !isApiRequest(),
      ...
  
  ```
  
  > **Comments:**
  > **username_1**: Thank you! Seems 'complete-payment' got renamed from 'completePayment' which is why the code from another post didn't work for me.  
  
  ---
  
  