【问题标题】:Squareconnect fails to retrieve location_idSquareconnect 无法检索 location_id
【发布时间】:2023-04-11 04:03:01
【问题描述】:

我正在尝试通过下面链接中提供的文档将方形付款方式嵌入我的网站。 https://docs.connect.squareup.com/articles/processing-payment-php/

收到 nonce 后,我正在尝试获取文档中定义的位置 ID。在控制台中它总是返回以下错误:

Fatal error: Uncaught exception 'SquareConnect\ApiException' with message 'API call to https://connect.squareup.com/v2/locations failed: SSL certificate problem: unable to get local issuer certificate' in C:\xampp\htdocs\my_project\vendor\square\connect\lib\ApiClient.php:245
Stack trace:
#0 C:\xampp\htdocs\my_project\vendor\square\connect\lib\Api\LocationApi.php(165): SquareConnect\ApiClient->callApi('/v2/locations', 'GET', Array, '', Array, '\\SquareConnect\\...')
#1 C:\xampp\htdocs\my_project\vendor\square\connect\lib\Api\LocationApi.php(105): SquareConnect\Api\LocationApi->listLocationsWithHttpInfo('sq0atb-a8CwQY9D...')
#2 C:\xampp\htdocs\my_project\locations-test.php(10): SquareConnect\Api\LocationApi->listLocations('sq0atb-a8CwQY9D...')
#3 {main}
  thrown in C:\xampp\htdocs\my_project\vendor\square\connect\lib\ApiClient.php on line 245

【问题讨论】:

    标签: php payment-gateway square-connect


    【解决方案1】:

    您可能没有最新的 CA 证书包。尝试此相关 StackOverflow 答案中的步骤,看看是否可行:https://stackoverflow.com/a/19149687

    如果这不起作用,您使用的是什么操作系统版本和 PHP 版本?在交互式 PHP 控制台 (php -a) 中,echo OPENSSL_VERSION_TEXT; 的输出是什么?最后,openssl s_client -connect connect.squareup.com:443 的输出是什么(在 cmd 中,不是 PHP 控制台)?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-02-14
      • 1970-01-01
      • 2012-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多