2017-04-19 90 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中的錯誤。它已經被修復。如果你更新上面提到的參數,你應該能夠立即進行交易。 –

相關問題