PayPal Billing-Plans Error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some Problem with PayPal billing-plans this is my code.
$url='https://'.PPURL.'/v1/payments/billing-plans/'.$resultGetPlanURL['id'].'/'; $JSONrequest='[ { "op": "replace", "path": "/", "value": { "state": "ACTIVE" } } ]'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Authorization: Bearer '.$_SESSION['access_token'] )); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $JSONrequest); $result = curl_exec($ch); $resultGetPlanActive = json_decode($result,true); curl_close ($ch);
The result i get is 'java.lang.NullPointerException'.
The Billing Plan ID is right and the access_token too.
Whats the problem?
I don't use SDK.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, the error you're getting looks to be a Java related error, but the code you posted looks to be PHP. Can you let me know a little more about what type of setup you have on your server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I saw this thread and thought that's exactly the same problem I have, so I wanted to provide a bit of information from my side.
I have a self written PHP application to integrate the Rest API.
I can successfully create a billing plan. But when trying to activate it the above Java exception is returned.
This strikes me as strange as normally API errors are returned as such.
Since this forum doesn't allow me to post my debug information, [here] is the link to my provisional test script.
Maybe someone can help and tell me what is wrong here.
Is this a PayPal problem or am I doing something wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the error, now.
The problem was that I used POST method for updating the billing plan but it has to be method PATCH.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Error message for obtaining access_token in REST APIs
- Couldn't receive International payment in PayPal Payments Standard
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment
- Things don’t appear to be working at the moment in PayPal Payments Standard
- Something went wrong. Contact the merchant for help. in PayPal Payments Standard