【问题标题】:How to access Square connect error "detail" with PHP?如何使用 PHP 访问 Square 连接错误“详细信息”?
【发布时间】:2019-02-25 09:08:16
【问题描述】:

我正在尝试使用 PHP SDK 检索 Square API 错误对象的 detail

这是我正在使用的代码:

$err = $e->getResponseBody()->errors['0']->detail;

这可行,但有没有更好的方法来返回错误消息?我已经阅读了文档中的error related info,但找不到任何代码来使用 PHP 获取 detail 属性。 谢谢!

【问题讨论】:

    标签: php square-connect


    【解决方案1】:

    您的想法是对的,但您可能想使用getDetail() 而不是->detail

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多