PayPal billing agreements error on create process using REST API SDK for PHP.

marlonmtz
Contributor
Contributor

Hi, I´m currently working with PayPal billing agreements on my web app and I´m getting an error when I try to create an agreement through the PayPal REST API SDK for PHP. My PayPal config file is on live mode and my credentials are setted correctly. This is the error (inside paypal.log file) that I get after trying to subscribe to a plan directly from my web app.

 

[01-0[Removed. Phone #s not permitted] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/oauth2/token
[01-0[Removed. Phone #s not permitted] PayPal\Core\PayPalHttpConnection : INFO: Response Status : 200
[01-0[Removed. Phone #s not permitted] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/billing-agreements/
[01-0[Removed. Phone #s not permitted] PayPal\Core\PayPalHttpConnection : INFO: Response Status : 400
[01-0[Removed. Phone #s not permitted] PayPal\Core\PayPalHttpConnection : ERROR: Got Http response code 400 when accessing https://api.paypal.com/v1/payments/billing-agreements/. {"name":"BUSINESS_VALIDATION_ERROR","details":[{"field":"validation_error","issue":"Incorrect Plan Id."}],"message":"Validation Error.","information_link":"https://developer.paypal.com/docs/api/payments.billing-agreements#errors","debug_id":"7583b1dc4e1cb"}

 

It says "Incorrect Plan Id" but the plan exists and the plan id that I´m passing is correct because all this process works fine on localhost, both sandbox and live mode work on localhost but when I try the same on my server I get this error. I also have single PayPal payments on my web app and they work fine.

 

I hope anyone could help me. Thank you.

Login to Me Too
1 REPLY 1

jrowan
Contributor
Contributor

Check to make sure that you have updated the billing plan to be ACTIVE

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.