title: Braintree server_side integration on android
body: <p>I need help integrating the server-side part of Braintree SDK in order to accept payments using Paypal.</p>
  
  <p>I am trying to use the PHP integration from this <a href="https://inducesmile.com/android/using-braintree-payment-in-android-to-accept-payment/" rel="nofollow noreferrer">link</a></p>
  
  <pre><code>&lt;?php
  include_once 'braintree-php-3.21.1/lib/Braintree.php';
  Braintree_Configuration::environment('sandbox');
  Braintree_Configuration::merchantId(' ');
  Braintree_Configuration::publicKey(' ');
  Braintree_Configuration::privateKey(' ');
  if(isset($_POST["NONCE"])){
    $nonceFromTheClient = $_POST["NONCE"];
    $result = Braintree_Transaction::sale([
      'amount' =&gt; '1000.00',
      'paymentMethodNonce' =&gt; $nonceFromTheClient,
      'options' =&gt; ['submitForSettlement' =&gt; true ]
    ]);
    if ($result-&gt;success) {
        echo("success!: " . $result-&gt;transaction-&gt;id);
    } else if ($result-&gt;transaction) {
        echo "Error processing transaction: \n" . " code: " . $result-&gt;transaction-&gt;processorResponseCode . " \n " . " text: " . $result-&gt;transaction-&gt;processorResponseText;
    } else {
        echo "Validation errors: \n"; //+ $result-&gt;errors-&gt;deepAll();
    }
  }else{
    echo($clientToken = Braintree_ClientToken::generate());
  }
  ?&gt;
  </code></pre>
  
  <p>But i keep getting this error
  <a href="https://i.stack.imgur.com/WtC8u.png" rel="nofollow noreferrer">IMAGE</a></p>
  
  <p>I am not excperienced in creating web apps, but It's a most and the braintree's docs are not detailed enough.</p>
  
  <p>If there is any sample i can use, in any other language it's fine by me.</p>