Hello, I have incorporated Smart Buttons into my shopping cart and they work perfectly up to a maximum of 5 items in the cart. However if I go above that number the PayPal browser opens momentarily then closes again. My button code is as follows: <script> function initPayPalButton() { paypal.Buttons({ style: { shape: 'pill', color: 'gold', layout: 'vertical', label: 'paypal', size: 'responsive', label: 'checkout', }, createOrder: function(data, actions) { /* tpvar gets the $total_price amount from the Cart*/ var tpvar = <?php echo json_encode($total_price); ?>; var descrvar = <?php echo json_encode($description); ?>; return actions.order.create({ purchase_units: [{"description":"Your FalnaMusic Order","amount":{"currency_code":"GBP","value":tpvar}}] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(orderData) { // Full available details console.log('Capture result', orderData, JSON.stringify(orderData, null, 2)); actions.redirect('https://www.fmtest.info/after_payment.php'); }); }, onError: function(err) { console.log(err); } }).render('#paypal-button-container'); } initPayPalButton(); </script> I have tried this in production and sandbox environments but the result is the same in both. I have also tested with different total prices to see if there was a limit on that, but it doesn't make any difference. The problem therefore seems to be with the actual number of items in the cart, but the Smart Button doesnt access this, only the total cost of the transaction, so I'm baffled. Could anyone help with this please? *******EDIT****** Now I've returned to my computer after a break of around 4 hours and would you believe it, it all seems to be working normally now, even though I haven't changed anything in the code during that time. If it stops working again I'll come back to this, but hopefully I wont need to trouble you any more!
... View more