所以我要在网站上放一个 PayPal 按钮,但这是我的问题,除了脚本标签外,我对 React 有点中间
出现了这个错误
Failed to compile.
./src/billings/paypal/connectwithpaypalbutton.js
Line 16:29: 'login' is not defined no-undef
Search for the keywords to learn more about each error.
这是带有 PayPal 按钮的代码,告诉我粘贴
class ConnectWithPayPal extends Component {
render() {
return (
<div>
<span id='cwppButton'></span>
<script src='https://www.paypalobjects.com/js/external/connect/api.js'></script>
<script>
<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": "",
"authend": "sandbox",
"scopes": "openid",
"containerid": "cwppButton",
"responseType": "code id_Token",
"locale": "en-us",
"buttonType": "CWP",
"buttonShape": "pill",
"buttonSize": "md",
"fullPage": "true",
"returnurl": ""
})
});
</script>
</script>
</div>
)
}
}