square - Square 退款 API 是否停止工作?
问题描述
使用 POS API (iOS) 创建的交易是否已停止退款?
一段时间以来,我们一直在使用Square Connect V2 API进行退款,我们还没有迁移到Payments API。
我们通过支付表单处理在线支付,并使用POS SDK (iOS)进行当面支付,并且使用现已弃用的create-refund端点对所有交易进行退款,没有任何问题。
但是现在突然之间,Unknown payment with id XXXXXXXXXXX
即使通过新的 Payments API 发出退款,当面交易的退款也开始回复错误。
当我调用列表付款方式时,所有在线交易都有对等付款并且退款有效,但对于面对面交易,没有对等付款记录。
示例请求:使用已弃用的 Transactions API
curl https://connect.squareup.com/v2/locations/LOCATION_ID/transactions/TRANSACTION_ID/refund \
-x POST \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"amount_money":{"currency":"USD","amount":100},"reason":"requested_by_customer","tender_id":"XXXXXXXXXXX","idempotency_key":"some-idempotency”}'
在线交易退款时的响应:
{"refund":{"id":"ZZZZZZZZZZZZZZZZZZZZ_YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY","location_id":"LOCATION_ID","transaction_id":"TRANSACTION_ID","tender_id":"XXXXXXXXXXX","created_at":"2020-01-28T19:20:27.672Z","reason":"requested_by_customer","amount_money":{"amount":100,"currency":"USD"},"status":"PENDING"}}
退还当面交易时的响应:
{"errors":[{"category":"INVALID_REQUEST_ERROR","code":"BAD_REQUEST","detail":"Unknown payment with id XXXXXXXXXXX"}]}
示例请求:使用 Payments API
curl https://connect.squareup.com/v2/refunds \
-x POST \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"amount_money":{"currency":"USD","amount":100},"reason":"requested_by_customer","payment_id":"XXXXXXXXXXX","idempotency_key":"some-idempotency"}'
在线交易退款时的响应:
{"refund": {"id": "ZZZZZZZZZZZZZZZZZZZZ_YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY","status": "PENDING","amount_money": {"amount": 100,"currency": "USD"},"payment_id": "XXXXXXXXXXX","order_id": "ORDER_ID","created_at": "2020-01-28T19:32:21.780Z","updated_at": "2020-01-28T19:32:21.970Z","location_id": "LOCATION_ID","reason": "requested_by_customer"}}
退还当面交易时的响应:
{"errors": [{"code": "BAD_REQUEST","detail": "Unknown payment with id XXXXXXXXXXX","category": "INVALID_REQUEST_ERROR"}]}
解决方案
推荐阅读
- google-colaboratory - Google Colab 中的 SentencePiece
- servo - 伺服在插件上移动。有时到 90 和停止。有时到 180 又回到 0
- java - 如何在飞镖中接受二维列表的值
- html - 卡片中的垂直滚动不会一直走
- python - 我可以使用@classmethod 访问实例变量吗?
- c++ - 从菜单中选择时如何只绘制矩形?
- botframework - 如何在 bot 框架中一起使用 ml luis 实体和列表实体
- payment - 对于 Paytm JS Checkoput
- ssl - HAProxy TCP (443) 不同后端端口的负载平衡
- google-apps-script - 如何从 DocumentApp、应用程序脚本中的 getParagraphs() 中排除表格单元格段落