无法从网络应用程序连接到 Square Register

Can't connect to Square Register from web app

我使用了 square api reference 中的这个确切示例:

<a href="intent:#Intent;action=com.squareup.register.action.CHARGE;package=com.squareup;S.browser_fallback_url=https://my.website.com/index.html;S.com.squareup.register.WEB_CALLBACK_URI=https://my.website.com/index.html;S.com.squareup.register.CLIENT_ID=sq0ids-yOurCLieNtId;S.com.squareup.register.API_VERSION=v1.3;i.com.squareup.register.TOTAL_AMOUNT=100;S.com.squareup.register.CURRENCY_CODE=USD;S.com.squareup.register.TENDER_TYPES=com.squareup.register.TENDER_CARD,com.squareup.register.TENDER_CARD_ON_FILE,com.squareup.register.TENDER_CASH,com.squareup.register.TENDER_OTHER;end">Send me $</a>

但是,尝试单击 link 会在注册应用程序中导致此错误:
意外的开发人员错误

Register API must be started with startActivityForResult() in the same task. It looks like the caller either used startActivity() or used startActivityForResult() from a finished activity or with the FLAG_ACTIVITY_NEW_TASK flag.

此处的错误信息不正确。文档中的示例使用“https://my.website.com/index.html”。您应该将其替换为来自您站点的有效回调 URI,并确保在 "Register API" 选项卡下的 Square 开发人员门户上进行注册。

您还需要将示例 com.squareup.register.CLIENT_ID Intent extra 替换为开发者门户中为您分配的 Square 应用程序 ID。