0

文档链接:https ://developer.squareup.com/docs/pos-api/build-mobile-web#step-5-test-your-code建议如下直接代码:

<a href="intent:#Intent;
action=com.squareup.pos.action.CHARGE;
package=com.squareup;
S.browser_fallback_url=https://my.website.com/index.html;
S.com.squareup.pos.WEB_CALLBACK_URI=https://my.website.com/index.html;
S.com.squareup.pos.CLIENT_ID=sq0ids-yourClientId;
S.com.squareup.pos.API_VERSION=v2.0;
i.com.squareup.pos.TOTAL_AMOUNT=100;
S.com.squareup.pos.CURRENCY_CODE=USD;
S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CASH;
end">Start Transaction</a>

我测试了它,它没有打开任何链接,我的设备已经安装了应用程序。

当我尝试这段代码时:

<a href="intent://scan/#Intent;scheme=squareup.pos;action=com.squareup.pos.action.CHARGE;package=com.squareup;end"> Take a QR code 2 </a>

它打开带有squareup pos应用信息的play store应用,我需要直接打开应用而不是播放应用的商店屏幕,有什么办法吗?

4

1 回答 1

1

*更新:

添加 S.com.squareup.pos.LOCATION_ID={{ my_location_id }} 后,我得到了交易。位置 ID 可以在 Square Developer Portal > Locations 中找到。此外,如果 POS 应用程序受密码保护,您必须在发送交易之前打开并使用密码登录。

*结束更新

我一直在解决同样的问题。我还没有进行交易,但至少已经打开了应用程序。

确保 CLIENT ID 是您的生产应用程序 ID。不是沙箱。

WEB_CALLBACK_URI 需要与 Square Developer Portal > Point Of Sale API 中定义的 Web 回调 URL 匹配。

我希望这有帮助。如果您确实解决了这个问题并让交易正常工作,请为我和其他由于缺少文档而肯定会遇到此问题的人发布您的解决方案。

于 2020-02-03T18:54:43.730 回答