Clarification on orphaned plan and agreement objects
I'm working on integrating Paypal's subscription service into a PHP application. I've noticed there are steps where plans and agreements can become abandoned or orphaned if the subscription flow is interrupted before the agreement actually becomes a subscription and some of the response data is not persisted properly. I'm looking for some clarification on how to retrieve these and how to properly discard or manage them, but it's not clear if it's even possible.
1. "Deleted" plans
Plans can be "deleted", which sets the status to "deleted" through the update/patch request. What happens when you "delete" a plan? There is no way to query for it once "deleted", so I'm wondering what I'm supposed to with all these test plans I've been creating. Do I just not worry about it and let Paypal take care of whatever it does with them?
2. Unapproved and unexecuted agreements
An agreement can be left unapproved by the customer after it was created, and it can also not get executed after a customer approves it. In both instances, the agreement is left abandoned. How do I managed these agreements? I understand I'll persist the payment token to keep track of the ongoing agreements until it becomes an active subscription, but it seems odd that they can be orphaned so easily without a clear method to deal with them.
Note: I tried to post it to the merchant technical forum, but it wouldn't let me.