hey guys, Idk what happened but suddenly my paypal express checkout button doesnt work and it says : Unsupported Media Type. I've copy and paste to make sure that I dont make any typo, but still it doesn't work. and this is my code var booking = $('.booking'), bill = booking.data('bill'), afterCheckOutUrl = booking.data('after-checkout-url'), orderId = booking.data('order-id'); paypal.Buttons({ createOrder: function (data, actions) { var el = $('.processing-loader'); el.show(); el.find('.text').text('Processing your payment...'); return actions.order.create({ purchase_units: [{ amount: { "currency_code": "USD", "value": bill } }] }); }, onApprove: function (data, actions) { return actions.order.capture().then(function (details) { // Call your server to save the transaction return fetch(afterCheckOutUrl, { method: 'post', headers: { 'content-type': 'application/json', 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, body: JSON.stringify({ orderID: orderId }) }) .then((res) => res.json()) .then( function(data){ window.location.href = data.redirect; }) .catch( function (err) { alert('payment error '+err) }); }); }, onCancel: function (data, actions) { var el = $('.processing-loader'); el.hide(); } }).render('#paypal-button-container'); } paypalPayment(); any help?
... View more