【发布时间】:2021-04-14 00:01:22
【问题描述】:
我正在尝试此代码,但它返回了此错误。我认为 clientID 的问题我用其他帐户更改了 clientID 然后它工作正常但是当我尝试实现代码中的这个 clientID 时,它显示错误. 任何可以在这方面帮助我的人。我将非常感谢你。
<head>
<title>Paypal Checkout</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Ensures optimal rendering on mobile devices. -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Optimal Internet Explorer compatibility -->
</head>
<body>
<script
src="https://www.paypal.com/sdk/js?client-id=Ae5Nri4XLfck8VR95yNNjYo8UymUe4n7Uk3DBID2UlkpemxB125veepMUkM5DxEiglownCaxa3jb1KR5">
</script>
enter code here
<div id="paypal-button-container"></div>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
purchase_units: [{
amount: {
value: '10'
}
}]
});
},
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(function(details) {
// This function shows a transaction success message to your buyer.
alert('Transaction completed by ' + details.payer.name.given_name);
console.log(details);
});
}
}).render('#paypal-button-container');
// This function displays Smart Payment Buttons on your web page.
</script>
</body>
【问题讨论】:
-
因为这更多是一个业务问题(特定帐户是问题而不是代码),所以我投票决定关闭,因为不可重现。
标签: javascript php paypal checkout