使用沙盒帐户的API错误

我想用documentation的示例代码来测试Web API。我的代码启动应用程序,但在应用程序中抛出错误:使用沙盒帐户的API错误

API错误 对不起,我们无法处理传入的请求。请重试或联系支持。

我的网址,我是它的编码后发送是follws:

square-commerce-v1://payment/create?data=%7B%22amount_money%22%3A%7B%22amount%22%3A%22500%22%2C%22currency_code%22%3A%22USD%22%7D%2C%22callback_url%22%3A%22https%3A%2F%2Fjaydien.ezservicetrax.com%2F%22%2C%22client_id%22%3A%22sandbox-sq0idp-CHLAPYt9s1L594ZZZysDSQ%22%2C%22version%22%3A%221.3%22%2C%22notes%22%3A%22notes%20for%20the%20transaction%22%2C%22options%22%3A%7B%22supported_tender_types%22%3A%5B%22CREDIT_CARD%22%2C%22CASH%22%2C%22OTHER%22%2C%22SQUARE_GIFT_CARD%22%2C%22CARD_ON_FILE%22%5D%7D%7D 

这里是我的代码:

<script> 

var dataParameter = {

"amount_money": {

"amount" : "500",

"currency_code" : "USD"

},

"callback_url" : "https://jaydien.ezservicetrax.com/", // Replace this value with your application's callback URL

"client_id" : "sandbox-sq0idp-CHLAPYt9s1L594ZZZysDSQ", // Replace this value with your application's ID

"version": "1.3",

"notes": "notes for the transaction",

"options" : {

"supported_tender_types" : ["CREDIT_CARD","CASH","OTHER","SQUARE_GIFT_CARD","CARD_ON_FILE"]

}

};

window.location = "square-commerce-v1://payment/create?data=" + encodeURIComponent(JSON.stringify(dataParameter));

</script>

我在做什么错?

回答:

这里的问题是您正在尝试使用您的沙盒应用程序/客户端ID。目前,我们不支持销售点API的沙箱,但您可以使用现金交易获得相同的效果。尽管这个错误信息可以改进,所以我会把它与团队一起提出来。

要修复您的错误,请将您的沙箱客户端/应用程序ID替换为您的实际:sq0idp-CHLAPYt9s1L594ZZZysDSQ

以上是 使用沙盒帐户的API错误 的全部内容, 来源链接: utcz.com/qa/258077.html

回到顶部