Square Connect 的 HTTP V1 和 V2 端点是否兼容?

Are Square Connect's HTTP V1 and V2 endpoints compatible?

长话短说:我尝试使用 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 端点是否兼容?

通常,v1 和 v2 端点是兼容的。如果您在 v1 Payments, you'll see the same info in v2 Transactions 中查找交易。

这里的问题是 order 在 v1 和 v2 世界中并不意味着同一件事。在 v1 中,订单是针对在线商店的订单,因此当您尝试 update an order, you are attempting to modify an order made with Online Store (Updates the details of an online store order.). Whereas the order you created with the v2 endpoint 时,会变成 Creates an Order that can then be referenced as order_id in a request to the Charge endpoint.

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