Embedded PayPal Login Button

半世苍凉 提交于 2019-12-11 14:01:07

问题


All,

I am trying to add a PayPal login button to my site based on https://developer.paypal.com/webapps/developer/docs/classic/loginwithpaypal/integration/. Currently, I am using PayPal sandbox therefore I use the static AppID "APP-80W284485P519543T" (https://www.x.com/developers/paypal/documentation-tools/quick-start-guides/paypal-apis-getting-started-guide).

The following is my JavaScript code

        <script src="https://www.paypalobjects.com/js/external/api.js"></script>
    <script>
        paypal.use( ["login"], function(login) {
        login.render ({
            "appid": "APP-80W284485P519543T",
            "authend": "https://www.sandbox.paypal.com/",
            "scopes": "profile email address phone https://uri.paypal.com/services/paypalattributes",
            "containerid": "myContainer",
            "locale": "en-us",
            "returnurl": "http://localhost:3000/"
            });
        });
    </script>

When I run it, I got the error "Relying Party Validation error: client_id provided in the request does not match any of the registered clients. Please check the request."

Any idea why and how to fix it?

Thank you in advance for the help!


回答1:


This happened to me.

Create a seller in sandbox.

https://developer.paypal.com/webapps/developer/applications/accounts

go to the profile of the seller and check the client id under Log In with PayPal credentials, use it as your appid. I also used only "sandbox" as value of "authend"

The funny thing is that Log In with PayPal credentials not appeared to me until I had made the steps bellow and checked the profile again, I really dont know why:

login to www.sandbox.paypal.com with the creted seller accont

go to: profile->Request API credentials Option 1 - PayPal API Set up PayPal API credentials and permissions Option 2 - Request API credentials to create your own API username and password.

Also, it only started working when I created a fake app in production...

The new sandbox still a beta...

let me know if it worked.




回答2:


you have to provide valid client_id as in the

https://developer.paypal.com/webapps/developer/applications/accounts

the login with PayPal button is sending to below URI which contains client_id

https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize?client_id=eee5d94d000903b29b1263ae5654b369&response_type=code&scope=openid%20profile%20email%20address%20https://uri.paypal.com/services/paypalattributes&redirect_uri=https://developer.paypal.com/webapps/developer/access&nonce=05d0a60ee1f44361f449496505e05116&state=784d8bc3fe3a48a5105b4f8ddd8ae0e7



来源:https://stackoverflow.com/questions/16025569/embedded-paypal-login-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!