我试图在网页上放置3个不同的PayPal智能按钮,但只有一个呈现(如图所示)。我已经尝试更改div id(正如您在代码中看到的那样),但问题仍然存在。如您所见,每个按钮都应该在一个td标签中,但页面上只显示一个。以下是所有3个按钮的代码。
<td><div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=AW70d1H_PLPMaT_7BK_kSGImw6w9DHpP2qHE3i6htPNCCOS9_dhVG52H3ITkdTWppulwYVC1NrMjgBaz¤cy=USD" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'blue',
layout: 'vertical',
label: 'paypal',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '3.60'
}
}],application_context: {
shipping_preference: 'NO_SHIPPING'
}
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
location.href = 'PayPal/premium_1.php';
});
}
}).render('#paypal-button-container');
</script>
</td>
<td><div id="paypal-button-container2"></div>
<script src="https://www.paypal.com/sdk/js?client-id=AW70d1H_PLPMaT_7BK_kSGImw6w9DHpP2qHE3i6htPNCCOS9_dhVG52H3ITkdTWppulwYVC1NrMjgBaz¤cy=USD" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'pill',
color: 'blue',
layout: 'vertical',
label: 'paypal',
},
素胚勾勒不出你
相关分类