const checkoutOrder = (state) => {
fetch('/script.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(state.cart)
});
return state;
};
<?
$data = $_POST;
var_dump(json_decode($data));
?>