Question: I have a weird issue with Paypal IPN. Every alternate transaction is failing. So let's say if first transactions goes well then second one fails. Similarly if 3rd one goes well then 4th one fails.
HTTP status code I am getting for failed transactions in IPN history is 400.
I have implemented the new Paypal host header changes that were newly introduced by them.

Any idea why this is happening?

**IPN History**  

<http://i.imgur.com/NfqRsGi.png>

**IPN Detail**  

<http://i.imgur.com/hcKdasw.png>

**EDIT**  

I am using PHP with curl to do IPN work (using same sample code as available on Paypal website)

**ANOTHER EDIT**  

Ok I found another code sample for PHP 5.2 from Paypal site. This one is slightly different than the one I am currently using. I tested it on Paypal Sandbox twice and it worked. Later on I will test it on live to see if it is working fine or not.

Answer: 
The first time the app wants to use location services, the system will show that alert. The user has the choice to enable it, but that alert will not be shown again. As a developer, you also don't have the ability to show it again.

What you could do, is check the `authorizationStatus` on `CLLocationManager`:

```
if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) {
    // show alert telling the user to enable location services for this app
}

```

You can't directly open the Settings app though.
Check the location services are enabled or not.If location services is not enabled so create a own UIAlertView with location serives massage.

```
if([CLLocationManager locationServicesEnabled] && 
     [CLLocationManager authorizationStatus] != kCLAuthorizationStatusDenied)
{
    // Show alert 
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex  
{
    if(alertView.tag == 1)
    {
        // set Url 
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];

    }
}

```