title: Fatal Error: Uncaught Braintree Exception in PHP
body: <p>I am using XAMPP latest version for mac and I am trying from this site <a href="https://www.appcoda.com/braintree-ios-integration/" rel="nofollow noreferrer">https://www.appcoda.com/braintree-ios-integration/</a></p>
  
  <p>PHP code is</p>
  
  <pre><code>&lt;?php
  require 'vendor/autoload.php';
  
  Braintree_Configuration::environment('sandbox');
  Braintree_Configuration::merchantId('**********');
  Braintree_Configuration::publicKey('**********');
  Braintree_Configuration::privateKey('************');
  
  // Get the credit card details submitted by the form
  $paymentMethodNonce =  $_POST['payment_method_nonce'];
  echo $paymentMethodNonce;
  
  $amount = $_POST['amount'];
  echo $amount;
  
  $result = Braintree_Transaction::sale([
    'amount' =&gt; $amount,
    'paymentMethodNonce' =&gt; $paymentMethodNonce,
    'options' =&gt; [
      'submitForSettlement' =&gt; True
    ]
  ]);
  
  echo json_encode($result);
  ?&gt; 
  </code></pre>
  
  <p>Why am I getting this error? I didn't understand from this site <a href="https://stackoverflow.com/questions/38014461/braintreegateway-uncaught-exception">braintreegateway Uncaught exception</a></p>
  
  <blockquote>
    <p><strong>Fatal error:</strong> Uncaught Braintree\Exception\SSLCertificate: Couldn't resolve host 'api.sandbox.braintreegateway.com' in /opt/lampp/htdocs/donate/vendor/braintree/braintree_php/lib/Braintree/Http.php:168 Stack trace: #0 /opt/lampp/htdocs/donate/vendor/braintree/braintree_php/lib/Braintree/Http.php(99): Braintree\Http->_doUrlRequest('POST', '<a href="https://api.san" rel="nofollow noreferrer">https://api.san</a>...', '_doRequest('POST', '/merchants/fxd6...', 'post('/merchants/fxd6...', Array) #3 /opt/lampp/htdocs/donate/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php(48): Braintree\TransactionGateway->_doCreate('/transactions', Array) #4 /opt/lampp/htdocs/donate/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php(290): Braintree\TransactionGateway->create(Array) #5 /opt/lampp/htdocs/dona in /opt/lampp/htdocs/donate/vendor/braintree/braintree_php/lib/Braintree/Http.php on line 168</p>
  </blockquote>