【问题标题】:Square Web API for Android Kills AppSquare Web API for Android Kills App
【发布时间】:2018-03-06 04:02:03
【问题描述】:

在遵循https://docs.connect.squareup.com/articles/web-api-android 找到的文档后,我无法通过 android 请求与方形阅读器成功连接

看起来很简单,但连接链接最终会导致应用程序崩溃或导致应用程序重新启动,而不会向S.browser_fallback_urlS.com.squareup.pos.WEB_CALLBACK_URI 发送任何错误报告或回调信息。

在开发服务器 (127.0.0.1) 上激活的示例链接是:intent:#Intent;action=com.squareup.pos.action.CHARGE;package=com.squareup;S.browser_fallback_url=http://localhost:8080/tb/square;S.com.squareup.pos.WEB_CALLBACK_URI=http://localhost:8080/tb/square;S.com.squareup.pos.CLIENT_ID=secret;S.com.squareup.pos.API_VERSION=v2.0;i.com.squareup.pos.TOTAL_AMOUNT=150;S.com.squareup.pos.CURRENCY_CODE=USD;S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CARD_ON_FILE,com.squareup.pos.TENDER_CASH,com.squareup.pos.TENDER_OTHER;S.com.squareup.pos.REQUEST_METADATA=5a982466e7b46;S.com.squareup.pos.NOTE=This will be a note!;end

对于CLIENT_ID,我被指示使用在https://connect.squareup.com/apps/ 找到的应用程序ID

非接触式固件,读卡器是2.9.36,通过蓝牙连接到安卓设备。

--编辑-- 第一次通过 https://ibb.co/kSBUYH https://ibb.co/fyUGDH 第二次通过 https://ibb.co/duFZ0x https://ibb.co/i1MUYH

【问题讨论】:

  • 哇!这不好!可以录制此行为的视频吗?
  • @tristansokol 图片已添加。视频会很无聊(:
  • 我只是想确认几件事,您的 POS 应用程序是否已在设备上完全设置?另外,我想确认您是实际上使用localhost 作为回调URL 还是使用192.168.88.41?最后,你是在隐身测试吗?我只是想确保您没有尝试使用带有过时 URL 的缓存页面。
  • @mootrichard 实际上使用 IP 进行回调。不在隐身。测试不是一个完整的 POS,只是方形功能。打印出页面顶部的数字是为了确保它不是缓存页面。
  • "The testing is not a complete POS" 你的意思是 POS 应用程序还没有设置吗? You should set it up if it hasn't been yet.

标签: android square-connect


【解决方案1】:

为了解决这个问题,问题是缺少在 Square Developer Portal 中注册的 Web 回调 URL。

You want to be sure to register your callback URL(s)

为了让 Square Point of Sale 接受来自您网站的请求,Square 需要验证您是否已在应用程序仪表板中为应用程序注册了 Web 回调 URI。

首先,转到应用程序仪表板,然后单击应用程序设置的销售点 API 选项卡。在 Web 部分下,在相应字段下指定您应用的 Web 回调 URI。

If your transaction does not succeed for any reason, you should be receiving a error back to you.

【讨论】:

  • 就我而言,这并没有解决问题。我卸载了 Square Point Of Sale ,然后重新安装了它,之后它就停止了崩溃。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-04
  • 2018-04-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多