title: Paypal error ppxo_no_token_passed_to_payment aka "No value passed to payment"
body: <p>I have implemented paypal express checkout in my app and everything was running smooth until I had to change my credentials today. For testing I used my own paypal account but now it has to be switched with the company's one, so I created a REST app and swapped the debug and production keys. Suddenly when I try to pay I get <code>ppxo_no_token_passed_to_payment</code>, if I switch back to my old public key its still working. I suspect this is an issue over at paypal where I need to authorize or enable the app or something but sadly I can not remember...</p>
  
  <p>Here is the code in question, but I do believe there is nothing wrong with it, as I said, if I put my old public key then it's still working fine.</p>
  
  <pre><code>  getPaypalButton(container: any, paypal: any) {
  
      return paypal.Button.render({
  
        env: __DEV__ ? "sandbox" : "production",
  
        style: this.style(),
  
        // Pass the client ids to use to create your transaction on sandbox and production environments
  
        client: {
          // from https://developer.paypal.com/developer/applications/
          sandbox: env.payments.paypal.sandbox, 
          production: env.payments.paypal.production
        },
  
        // Pass the payment details for your transaction
        // See https://developer.paypal.com/docs/api/payments/#payment_create for the expected json parameters
        payment: this.payment.bind(this),
  
        // Display a "Pay Now" button rather than a "Continue" button
        commit: true,
  
        // Pass a function to be called when the customer completes the payment
        onAuthorize: this.authorize.bind(this),
  
        // Pass a function to be called when the customer cancels the payment
        onCancel: this.cancel.bind(this)
  
      }, container)
  
    style() {
      return {
        label: 'paypal',
        size: 'responsive',    // small | medium | large | responsive
        shape: 'rect',     // pill | rect
        color: 'blue',     // gold | blue | silver | black
        tagline: false
      };
    }
  
    payment(data: any, actions: any) {
  
      return actions.payment.create({
        transactions: [
          {
            amount: {
              total: i18n.currencies.toHumanReadable(this.moneyControl.internalInput.value, "EUR").toFixed(2),
              currency: "EUR"
            }
          }
        ]
      }).catch((error: any) =&gt; {
        if (!this.moneyControl.internalInput.value) {
          this.moneyControl.displayError("validation.required");
        } else {
          this.moneyControl.displayError("deposit.paypalerror");
        }
      });
    }
  
    authorize(data: any, actions: any) {
      return web.request("/paypal", {
        method: "POST",
        data: {
          token: data.paymentToken,
          payment_id: data.paymentID,
          payer_id: data.payerID
        }
      }).then((response: any) =&gt; {
        console.log('The payment was completed!', response);
  
        this.completed();
      }).catch(function (error) {
        console.log(error);
      });
    }
  
    cancel(data: any) {
      this.moneyControl.displayError("deposit.paypalcancel");
    }
  </code></pre>
  
  <p>One thing to notice is that the thrown error says <code>env: "production"</code>, however <code>__DEV__</code> is <code>true</code>.</p>
  
  <pre><code>country: "US"
  env: "production"
  host: "192.168.0.100:8080"
  lang: "en"
  pageID: ...
  path: "/"
  prev_corr_ids: ""
  referer: "192.168.0.100:8080"
  timestamp: 1528128652378
  uid: ...
  ver: "4.0.199"
  windowID: ...
  </code></pre>