Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法验证Adyen';s的SSL证书。日元付款_Php_Ssl_Curl - Fatal编程技术网

Php 无法验证Adyen';s的SSL证书。日元付款

Php 无法验证Adyen';s的SSL证书。日元付款,php,ssl,curl,Php,Ssl,Curl,当我在本地服务器上请求创建付款时,出现以下错误。我使用以下api进行付款 下面是我用来创建付款的代码 <?php error_reporting(E_ALL); ini_set('display_errors', 1); include 'vendor/autoload.php'; if(isset($_POST['adyen-encrypted-data'])) { echo 'test'; $client = new \Adyen\Client(); $clie

当我在本地服务器上请求创建付款时,出现以下错误。我使用以下api进行付款

下面是我用来创建付款的代码

<?php error_reporting(E_ALL);
ini_set('display_errors', 1);
include 'vendor/autoload.php';
if(isset($_POST['adyen-encrypted-data']))
{
    echo 'test';
    $client = new \Adyen\Client();
    $client->setApplicationName("Adyen PHP Api Library Example");
    $client->setUsername("myusername");
    $client->setPassword("mypassword");
    $client->setEnvironment(\Adyen\Environment::TEST);

    $service = new Adyen\Service\Payment($client);

    $json = '{
              "amount": {
                "value": 1499,
                "currency": "GBP"
              },
              "reference": "payment-test",
              "merchantAccount": "mymerchantaccount",
              "additionalData": {
                "card.encrypted.json": "'.$_POST["adyen-encrypted-data"].'"
              }
            }';

    $params = json_decode($json, true);

    $result = $service->authorise($params);
    var_dump($result);
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <link rel="stylesheet" href="">
</head>
<body>
<script type="text/javascript" src="https://test.adyen.com/hpp/cse/js/8214937568103526.shtml"></script>
    <form method="POST" action="pay.php" id="adyen-encrypted-form">
        <input type="text" size="20" data-encrypted-name="number"/>
        <input type="text" size="20" data-encrypted-name="holderName"/>
        <input type="text" size="2" data-encrypted-name="expiryMonth"/>
        <input type="text" size="4" data-encrypted-name="expiryYear"/>
        <input type="text" size="4" data-encrypted-name="cvc"/>
        <input type="hidden" value="<?php echo date('Y-m-d').'T'.date('H:i:s', time()).'000Z'; ?>"  data-encrypted-name="generationtime"/>
        <input type="submit" value="Pay"/>
    </form>
    <script>
    // The form element to encrypt.
    var form = document.getElementById('adyen-encrypted-form');
    // See https://github.com/Adyen/CSE-JS/blob/master/Options.md for details on the options to use.
    var options = {};
    // Bind encryption options to the form.
    adyen.createEncryptedForm(form, options);
    </script>
</body>
</html> 


我可以通过遵循帖子中的解决方案来修复它

这是Windows中非常常见的问题。只需将cacert.pem设置为curl.cainfo

从PHP 5.3.7开始,您可以:

下载并保存到某个地方。 更新php.ini——将curl.cainfo=“PATH\u添加到/cacert.pem” 否则,您将需要对每个cURL资源执行以下操作:

curl_setopt($ch,CURLOPT_CAINFO,“路径到/cacert.pem”)

<?php error_reporting(E_ALL);
ini_set('display_errors', 1);
include 'vendor/autoload.php';
if(isset($_POST['adyen-encrypted-data']))
{
    echo 'test';
    $client = new \Adyen\Client();
    $client->setApplicationName("Adyen PHP Api Library Example");
    $client->setUsername("myusername");
    $client->setPassword("mypassword");
    $client->setEnvironment(\Adyen\Environment::TEST);

    $service = new Adyen\Service\Payment($client);

    $json = '{
              "amount": {
                "value": 1499,
                "currency": "GBP"
              },
              "reference": "payment-test",
              "merchantAccount": "mymerchantaccount",
              "additionalData": {
                "card.encrypted.json": "'.$_POST["adyen-encrypted-data"].'"
              }
            }';

    $params = json_decode($json, true);

    $result = $service->authorise($params);
    var_dump($result);
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <link rel="stylesheet" href="">
</head>
<body>
<script type="text/javascript" src="https://test.adyen.com/hpp/cse/js/8214937568103526.shtml"></script>
    <form method="POST" action="pay.php" id="adyen-encrypted-form">
        <input type="text" size="20" data-encrypted-name="number"/>
        <input type="text" size="20" data-encrypted-name="holderName"/>
        <input type="text" size="2" data-encrypted-name="expiryMonth"/>
        <input type="text" size="4" data-encrypted-name="expiryYear"/>
        <input type="text" size="4" data-encrypted-name="cvc"/>
        <input type="hidden" value="<?php echo date('Y-m-d').'T'.date('H:i:s', time()).'000Z'; ?>"  data-encrypted-name="generationtime"/>
        <input type="submit" value="Pay"/>
    </form>
    <script>
    // The form element to encrypt.
    var form = document.getElementById('adyen-encrypted-form');
    // See https://github.com/Adyen/CSE-JS/blob/master/Options.md for details on the options to use.
    var options = {};
    // Bind encryption options to the form.
    adyen.createEncryptedForm(form, options);
    </script>
</body>
</html>