0

我试图在我的网页上获得一个基本的 PayPal 按钮,但我什至无法加载 API 而不会出错。我已经在 PayPal 自己的论坛上寻求帮助,但没有人回复。

这是我的页面。我在沙盒模式下运行。我已将下面的实际客户 ID 替换为 [CLIENTID]。

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <title>PayPal test</title>
</head>

<body>
    <script src="https://www.paypal.com/sdk/js?debug=true&client-id=[CLIENTID]"></script>    
</body>
</html>

我可以在页面上添加一个按钮并进行购买,因此购买过程有效。但它总是在页面加载时抛出这个错误。我在 Win10,Brave 浏览器(基于 Chromium)。

js?debug=true&client…ruzpDLhao-FzS6:2659 unhandled_error 
{err: "Error: Invalid json: .↵    at XMLHttpRequest.<anon…[CLIENTID]:2597:55)", timestamp: "1601234382102", referer: "localhost", uid: "9b7c68f416_mtk6mtc6ntq", env: "sandbox"}
env: "sandbox"
err: "Error: Invalid json: .↵    at XMLHttpRequest.<anonymous> (https://www.paypal.com/sdk/js?debug=true&client-id=[CLIENTID]:2597:55)"
referer: "localhost"
timestamp: "1601234382102"
uid: "9b7c68f416_mtk6mtc6ntq"
__proto__: Object

==================================================== ==============

更新

对不起,我写错了我在谷歌浏览器上。我正在使用 Brave Browser(基于 Chromium)。我已经在 Google Chrome 和 MS Edge 上进行了测试,它在那里工作。勇敢是错误发生的地方。我试图添加一个新的沙盒应用程序,但得到了同样的错误。我使用了 Brave 浏览器设置来允许我的站点拥有所有权限,但仍然出现同样的错误。

现场测试:

只需加载 API:https ://www.trainerslab.app/PayPalTest.html

来自 PayPal 开发网站的示例:https ://www.trainerslab.app/PayPalTest2.html

截屏:

在此处输入图像描述

4

0 回答 0