Square 创建付款时权限不足,无法设置 app_fee_money

问题描述

  1. 我使用 Square Oauth 获取 merchant_access_token 使用范围
CUSTOMERS_WRITE
CUSTOMERS_READ
ITEMS_WRITE
ITEMS_READ
MERCHANT_PROFILE_WRITE
MERCHANT_PROFILE_READ
ORDERS_WRITE+ORDERS_READ
PAYMENTS_WRITE
PAYMENTS_READ
PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS

来自https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees

当我运行命令时,我得到 Insufficient permissions to set app_fee_money

我从应用程序和邮递员那里都试过了

我做错了什么?

curl --location --request POST 'https://connect.squareupsandBox.com/v2/payments' \
--header 'Square-Version: 2021-01-21' \
--header 'Authorization: Bearer merchant_access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "source_id": "ccof:customer-card-id-ok","idempotency_key": "6726cbd2-7893-4cc3-908e-c54731e9f1fe77979","amount_money": {
        "amount": 5000,"currency": "USD"
    },"app_fee_money": {
        "amount": 1220,"customer_id": "676YFJE8CCRPZ2K7F9C155JYP8","location_id": "LG5CC4T0JXCX9",//Merchant location id
    "order_id": "M4C0LcxaW6DNpbyxE7sLypvbFA8zb4F","reference_id": "M4C0LcxaW6DNpbyxE7sLypvbFA8zb4F","statement_description_identifier": "Organization name","note": "Fee note"
}'

解决方法

PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS 在代码中,但没有运行它的旧版本范围,修复了它。谢谢@sjosey