无效的返回无效的客户端ID或重定向URI

目前我正在尝试使用PayPal OAuth登录我的Web应用程序。但是,我收到此错误

客户端代码

<script src="https://www.paypalobjects.com/js/external/connect/api.js"></script>
<script>
  paypal.use(["login"], function (login) {
    login.render({
      appid:
        "<I took from the client id>",
      scopes: "openid profile email address",
      containerid: "cwppButton",
      responseType: "code",
      locale: "en-us",
      buttonType: "CWP",
      buttonShape: "pill",
      buttonSize: "md",
      fullPage: "true",
      returnurl: "http://127.0.0.1:8080/paypal-return",
    });
  });
</script>

客户端ID

返回URL

我在这里遗漏了什么,我找不到指向正确方向的错误。

谢谢


解决方案

使用以下代码,它可以为我工作。我也有同样的问题,并包括了这个:&auend";:";Sandbox"; 完整代码:

    <span id='lippButton'></span>
    <script src='https://www.paypalobjects.com/js/external/api.js'></script>
    <script>
        paypal.use( ['login'], function (login) {
            login.render ({
                "appid":"<MY APP ID>",
                "authend": "sandbox",
                "scopes":"openid",
                "containerid":"lippButton",
                "responseType":"code",
                "locale":"en-us",
                "buttonType":"LWP",
                "buttonShape":"pill",
                "buttonSize":"lg",
                "fullPage":"true",
                "returnurl":"http://127.0.0.1/CyFlying/public/"
            });
        });
    </script>

相关文章