【问题标题】:amazon pay error client_Id undefined亚马逊支付错误client_Id未定义
【发布时间】:2018-06-05 16:16:52
【问题描述】:

我在我的 asp.net 代码中集成了 amazon pay API。我写了以下代码

<!-- language: lang-js -->
<script type='text/javascript'>
    window.onAmazonLoginReady = function () {
        amazon.Login.setClientId('<%=ConfigurationManager.AppSettings["lwa_client_id"]%>');
        amazon.Login.setUseCookie(true);
    };
                        </script>
<script async type='text/javascript' src='https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js'></script>
<script type='text/javascript'>
    OffAmazonPayments.Button("AmazonPayButton", '<%=ConfigurationManager.AppSettings["merchant_id"]%>', {
        type: "PwA",
        authorization: function () {
            debugger;
            loginOptions = { scope: "profile postal_code payments:widget payments:shipping_address", popup: true };
            amazon.Login.authorize(loginOptions, "/AmazonProcessing");
        },
        onError: function (error) {
            // something bad happened
        }
    });
 </script>

它呈现亚马逊支付按钮。但是当我点击它时,它会显示404错误的弹出窗口。

它以前工作过。我不会更改亚马逊上的任何设置。我已经检查了 JavaScript Cross 的起源。我已经添加了带有端口的本地主机。 如何解决这个问题?

【问题讨论】:

标签: amazon amazon-pay


【解决方案1】:

客户端 ID 的值可能未从您的应用程序设置中正确填充(错误“Unknown client_id”和错误摘要“client_id=undefined”)。

您应该可以在带有“setClientId”的行的JavaScript中设置一个断点来验证客户端ID是否有值。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-02
    • 2013-04-15
    • 2020-03-23
    • 1970-01-01
    • 2020-05-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多