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: "<?php echo($_SESSION["total_price"]); ?>"
}
}]
});
},
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);
});
}
}).render('.Paypal');
Кнопка отображается при перезагрузке страницы, но НЕ при первом посещении страницы.
value: "<?php echo($_SESSION["total_price"]); ?>"
У меня такое ощущение, что код PHP не достигает своего места назначения до того, как его рендеринг вызывает ошибку
Есть идеи?
Помощь очень ценится