“errorId”:“560022”,“message”:“X-PAYPAL-APPLICATION-ID标头包含无效值”,“参数”:[“X-PAYPAL-APPLICATION-ID”]

I'm not using the sandbox endpoint (I've tried that as well with the sandbox app-id, but that gives me wrong credentials error) and am trying to verify a payment.

I'm using the following function in PHP:

function verify_paypal($payKey)
{
  global $payPalUser_Is, $payPalPassword, $payPalSig, $appID;
$headerArray = array(
'X-PAYPAL-SECURITY-USERID:'.$payPalUser_Id,
'X-PAYPAL-SECURITY-PASSWORD:'.$payPalPassword,
'X-PAYPAL-SECURITY-SIGNATURE:'.$payPalSig,
'X-PAYPAL-REQUEST-DATA-FORMAT:JSON',
'X-PAYPAL-RESPONSE-DATA-FORMAT:JSON',
'X-PAYPAL-APPLICATION-ID:'.$appID
);
echo "$headerArray, $appID";
$url="https://svcs.paypal.com/AdaptivePayments/PaymentDetails?payKey={$payKey}&requestEnvelope.errorLanguage=en_US";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerArray);
$adaptiveResponse = curl_exec($ch);
curl_close($ch);

echo $adaptiveResponse;
//return true or false, still got to handle the response
};

But it gives the error that the app-id is not correct. I use the same ID to process payments from the android-app with no problem. Anybody any clue which ID I should use?

REQUEST-DATA should be NV:

$headerArray = array(
'X-PAYPAL-SECURITY-USERID:'.$payPalUser_Id,
'X-PAYPAL-SECURITY-PASSWORD:'.$payPalPassword,
'X-PAYPAL-SECURITY-SIGNATURE:'.$payPalSig,
'X-PAYPAL-REQUEST-DATA-FORMAT:NV',
'X-PAYPAL-RESPONSE-DATA-FORMAT:JSON',
'X-PAYPAL-APPLICATION-ID:'.$appID
);