2017-04-19 91 views
1

我用从square api reference这个确切的例子:无法连接到从Web应用程序坊注册

<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> 

然而,试图点击链接导致此错误在注册应用程序:
意外的开发错误

注册API必须在同一个 任务中以startActivityForResult()启动。它看起来像调用者使用startActivity()或从已完成的活动中使用了 startActivityForResult(),或者使用了 FLAG_ACTIVITY_NEW_TASK标志。

+0

哪个版本的Square Point of Sale应用有你的Android版本? – tristansokol

+0

Square POS是4.62.1 手机是运行Android 7.1.2的Pixel XL –

+0

我现在也遇到了这个错误,以前的Web应用程序曾经工作。 Square最近更新了,我无法弄清楚我调用它的方式有错误还是代码中有错误。 – JonG

回答

1

这里的错误消息是不正确的。文档中的示例使用“https://my.website.com/index.html”。您应该从您的站点替换为有效的回调URI,并确保将其注册在Square开发人员门户的“注册API”选项卡下。

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

+0

更新:此错误是由于API中的错误。它已经被修复。如果你更新上面提到的参数,你应该能够立即进行交易。 –

相关问题