ajax call to php with redirect

ajax call to php with redirect

Hi

I am creating a site where make a ajax call to php that saves my data to mysql then uses some api to paypal and then redirects to paypal to make the payment.

when I built my test php and referenced direct all works great.  Now I am using ajax to post the data to the file I get a 302 header response and the redirect doesn't happen.  I believe this is down to how ajax is behaving but no idea what, is there away I can make this work? here is my ajax call and response fromm php.

   $.ajax(
      {
            url: 'php/processorder.php',
            data: {my_json_data: json}, // tableObject},
            type: 'POST',
            async: false,
            dataType: 'json',
            cache:false
       });

php

header("Location: {$approvalUrl}");