Subscriptions integration - creating a plan ID

nicklem
New Community Member

Hi,

 

I'm implementing an on-page payment solution using the Smart Payment Buttons, as described here:

https://developer.paypal.com/docs/subscriptions/integrate/

 

The process described requires to generate a plan ID and pass it to the Buttons createSubscription method.

 

It is suggested to use curl calls to generate said plan ID, but this may not cut it for us.

Our payment amounts will likely vary; it's a plugin meant for recurring donations, with user-selected amounts, so it would be important to be able to generate a plan on the fly.

 

This on-page solution is meant to replace an older SDK that we were using,

https://github.com/paypal/PayPal-PHP-SDK

which handled the creation of the plan and activation of the agreement on the server:

https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/billing/CreateBillingAgreementWithPayPal...

 

I tried reusing the existing server code to generate a plan on the back-end and pass its ID to the Buttons, but it's not working and I'm getting a 404 response when the button POSTs the plan ID to https://www.sandbox.paypal.com/v1/billing/subscriptions:

{issue: "INVALID_RESOURCE_ID", description: "Requested resource ID was not found."}

 

My question:

- Does the PayPal-PHP-SDK play well with the Buttons? Are these two solutions compatible?

- If it does not, is there a compatible/updated SDK to generate the plan ID, or am I expected to implement the code on my own, using the API curl calls as reference?

 

Thanks!

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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