【问题标题】:Stripe payment ssl protocol error WordPress条纹支付 ssl 协议错误 WordPress
【发布时间】:2017-04-29 23:52:42
【问题描述】:

我们使用 PHP 进行了条带支付。它在本地机器上工作,但在实时服务器上,它没有按预期工作。我们分享了我们使用的代码,并附上了错误的屏幕截图。不知道哪里出错了,能指导一下吗?

条码:

require_once('Stripe.php');

Stripe::setApiKey('secret key');

echo '<form action="" method="post">
  <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
          data-key="publish key"
          data-description="Access for a year"
          data-amount="5000"
          data-locale="auto"></script>
</form>';

if($_POST) {
 $token  = $_POST['stripeToken'];

  $customer = Stripe_Customer::create(array(
      'email' => 'customer@example.com',
      'source'  => $token
  ));

  $charge = Stripe_Charge::create(array(
      'customer' => $customer->id,
      'amount'   => 5000,
      'currency' => 'usd'
  ));

  echo '<h1>Successfully charged $50.00!</h1>';

}

本地机器

实时服务器

【问题讨论】:

    标签: wordpress ssl ssl-certificate stripe-payments stripe-connect


    【解决方案1】:

    1) 看起来您可能没有将条带 php 绑定附带的 data 文件夹复制到您的服务器 --- 这包含在 failed loading cafile 错误中引用的 ca-certificates.crt 文件。确保此文件夹存在于您的服务器上,看看是否能解决问题!

    2) 如果您仍然遇到问题,则该问题可能涉及您的服务器无法通过 TLS 1.2 与 Stripe 进行通信。从您的语法看来,您使用的是旧版本的 Stripe 的 PHP 库,因此您需要在此处使用第二个示例 test that。

    如果 curl 能够首先建立 TLS 1.2 连接,您还可以运行测试脚本 like this 来帮助确定您的 libcurl 和 openssl 版本。如果你需要升级 curl 和 openssl 一些有用的建议是here。您也可以就此事与您的系统管理员或网络主机聊天。

    【讨论】:

      猜你喜欢
      • 2014-12-06
      • 1970-01-01
      • 2017-03-02
      • 2017-09-14
      • 2016-02-01
      • 2015-11-27
      • 2021-11-14
      • 2021-05-04
      • 2018-03-25
      相关资源
      最近更新 更多