Billing Agreement id assign with user in my database.

radkovsky
New Community Member

I successfully implemented Paypal subscriptions into my app, this are the steps to do create subscription plan and accept it by user:

 

1. Create billing plan - https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_create 

2. Activate billing plan - https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_update 

3. Create billing agreement - https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_create 

4. Redirect buyer to approve agreement (using redirect URL provided in response of 'create billing agreement')

5. Execute the agreement (passing the token returned after buyer approval)

6. The "ID" will be returned in the response and starts with "I-XXXXXXX"- https://developer.paypal.com/docs/api/payments.billing-agreements/v1/#billing-agreements_execute

 

But i can't figure it out, how can i connect this steps with my database user. When user finish payment in step number 5, user is successfully redirected to my site and i can activate(execute) agreement with token. But how can i connect this agreement with my database user? After successful payment, i want to assign to this user Agreement ID and change user status to "active subscriber".

Can i pass somewhere, for example in step 3, user id ? Is this possible?

 

I'm using Rails + PayPal-Ruby-SDK (version 2.0-beta).

Login to Me Too
1 REPLY 1

secretbook
Contributor
Contributor

Did you figure this out?

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.