gpt4 book ai didi

php - fatal error : Uncaught Braintree Exception in PHP

转载 作者:行者123 更新时间:2023-11-30 11:26:11 26 4
gpt4 key购买 nike

我正在使用适用于 mac 的 XAMPP 最新版本,我正在尝试从此站点 https://www.appcoda.com/braintree-ios-integration/

PHP 代码是

<?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);
?>

为什么我会收到此错误?我不明白这个网站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

最佳答案

全面披露:我在 Braintree 工作。如果您还有任何疑问,请随时联系 support .

您看到的错误是由于您的服务器未使用 TLSv1.2。自 2016 年 12 月 13 日起,我们不再接受在 Sandbox 环境中使用 SSL(任何版本)、TLSv1.0 或 TLSv1.2 的连接。您可以找到有关此更改的更多信息 in our blog post 。这些变化也将很快影响我们的生产环境。

要查找 cURL 的 OpenSSL 信息,请运行:

php -r 'echo json_encode(curl_version(), JSON_PRETTY_PRINT);'

您可以查看PayPal Guideline用于更新您的 SSL/TSL 库以及用于更新您计算机上的 OpenSSL 版本的信息。

关于php - fatal error : Uncaught Braintree Exception in PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50715880/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com