+-

我正在尝试在沙盒中测试Paypal纠纷,并遵循本指南:https://developer.paypal.com/docs/integration/direct/customer-disputes/integration-guide/#sandbox-only-methods。
但是,在第2步(从买方获得许可)上,贝宝提供的用于生成连接按钮的代码引发js语法错误,所以我将其更改为:
<span id='cwppButton'></span>
<script src="https://www.paypalobjects.com/js/external/connect/api.js"></script>
<script>
paypal.use( ['login'], function (login) {
login.render ({
"appid": "MY_CLIENT_ID",
"authend": "sandbox",
"scopes": "openid",
"containerid": "cwppButton",
"locale": "en-us",
"buttonType": "CWP",
"buttonSize": "lg",
"returnurl": "https://a62add0d.ngrok.io/api/payments/paypal/get-token/"
});
});
</script>
您如何看到我将范围更改为仅“ openid”,因为在此示例中将贝宝提供的链接分隔开给我“无效范围”错误但是,在此步骤中,我从按钮获得了访问令牌。我面临的下一个问题是在第4步(为PayPal授权声明生成JSON Web令牌)上,paypal提供的代码给出了语法错误,因此我将其替换为:]
<span id='cwppButton'></span> <html> <script> function base64url(source) { encodedSource = btoa(source); encodedSource = encodedSource.replace(/=+$/, '"'); encodedSource = encodedSource.replace(/\+/g, '-'); encodedSource = encodedSource.replace(/\//g, '-'); return encodedSource; } function generateJWT() { var header = {"alg": "none", "typ": "JWT"}; var data = {"iss" :"MY_CLIENT_ID", "email" : "[email protected]" }; document.write(base64url(JSON.stringify(header)) + "." + base64url(JSON.stringify(data)) + "."); } </script> <body onload="generateJWT()"/>并且在第6步中运行创建争议请求后,我收到此错误:
{ "error": "invalid_request", "error_description": "No permissions to set target_client_id" }我的问题是如何在沙盒中正确设置和测试Paypal纠纷?如果有人在争议测试中遇到相同的问题?
我正在尝试在沙盒中测试Paypal争议,并遵循了该指南:https://developer.paypal.com/docs/integration/direct/customer-disputes/integration-guide/#sandbox-only-methods。 ...
0
投票
投票
从步骤1 https://developer.paypal.com/docs/integration/direct/customer-disputes/integration-guide/#sandbox-only-methods开始: