Using paypal.Buttons when creating an order through createOrder pp successfully processes our request then returns to our original page, not the onApprove actions.redirect page we specify. The error processing function does not come into play also. Works fine in the sandbox. Any ideas what is happening? TIA // Sets up the transaction when a payment button is clicked createOrder: function(data, actions) { var gtotal = document.getElementById('gtotal').value; gtotal = gtotal.replace('£', ''); var sessionID = document.getElementById('sessionID').value; var discount = document.getElementById('discount').value; discount = discount.replace('£', ''); return actions.order.create({ purchase_units: [{ amount: { value: gtotal } }] }); }, // Finalise the transaction after payer approval onApprove: function(data, actions) { return actions.order.capture().then(function(orderData) { // Successful capture! var transaction = orderData.purchase_units[0].payments.captures[0]; // All done - over to email page ... actions.redirect(server + 'ordering6pp.php?transactionstatus=' + transaction.status + '&transactionid=' + transaction.id + '&sessionID=' + sessionID + '&discount=' + discount + '>otal=' + gtotal + '&amount=' + amount + '¤cy=' + currency + '&orderNumber=' + orderNumber); }); }, // Error handling - Cancelled onCancel: function(data) { // Show a cancel page, or return to cart $('#errMessage').html("<span class='alert alert-danger fs-round fw-bold mt-5 mb-2'><span class='material-icons'>report</span> Error - PayPal payment cancelled - Choose another payment method.</span>"); }, // Error handling onError: function(err) { $('#errMessage').html("<span class='alert alert-danger fs-round fw-bold mt-5 mb-2'><span class='material-icons'>report</span> Error - PayPal payment error - Please try again.</span>"); window.location.href = "ordering-error.php"; }
... View more