I am using XAMPP latest version for mac and I am trying from this site https://www.appcoda.com/braintree-ios-integration/
PHP code is
<?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' => $amount,
'paymentMethodNonce' => $paymentMethodNonce,
'options' => [
'submitForSettlement' => True
]
]);
echo json_encode($result);
?>
Why am I getting this error? I didn't understand from this site braintreegateway Uncaught exception
Fatal error: 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', 'https://api.san...', '_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