Hi I'm trying to activate my paypal billing plan with PHP Curl but I keep getting 'java.lang.NullPointerException1' returned
Here's my code
curl_init($ch);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
$resultTwo = curl_exec($ch);
Likely you're seeing a bug in the PayPal Sandbox backend. Please submit it to merchant support and include the full response, including the Debug-Id
header.
Read documentation carefully. cURL sends data with POST method as default, but documentation says, you shoud use GET.
Solution is:
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");