【问题标题】:Are Square Connect's HTTP V1 and V2 endpoints compatible?Square Connect 的 HTTP V1 和 V2 端点是否兼容?
【发布时间】:2017-12-29 07:32:57
【问题描述】:

长话短说:我尝试使用 V2 端点创建订单,然后使用 V1 端点对其进行编辑。

首先,我创建了订单,结果如下:

{
"order": {
    "id": "OaL2MCgsn4gdBsemaz8wIFaxM2WMKLLDR7BwdeCl8T...",
"location_id": "8Q5T7REMOVED",
"reference_id": "my-order-001",
    (and so on)
    }
}

然后我尝试使用以下 URL 关闭订单:

https://connect.squareup.com/v1/{{location_id}}/orders/OaL2MCgsn4gdBsemaz8wIFaxM2WMKLLDR7BwdeCl8Te...

但是回复是

{
    "type": "not_found",
    "message": "NotFound"
}

由于没有找到我刚下的订单,我怀疑 V1 和 V2 端点不兼容。那,或者我的方法不正确。

方形 V1 和 V2 端点是否兼容?

【问题讨论】:

    标签: square-connect


    【解决方案1】:

    通常,v1 和 v2 端点是兼容的。如果您在v1 Payments 中查找交易,您将在v2 Transactions 中看到相同的信息。

    这里的问题是order 在 v1 和 v2 世界中的含义不同。在 v1 中,订单用于在线商店订单,因此当您尝试 update an order 时,您正在尝试修改使用 Online Store (Updates the details of an online store order.) 下的订单。而您使用v2 endpoint 创建的订单被整合到Creates an Order that can then be referenced as order_id in a request to the Charge endpoint.

    如果您尝试修改订单,然后将 id 发送到 Charge 端点,此时您不能这样做,而应该只创建一个新订单。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-27
      • 2018-04-12
      • 2016-01-13
      • 1970-01-01
      • 2010-10-16
      • 1970-01-01
      • 2014-08-04
      • 2019-08-16
      相关资源
      最近更新 更多