Disable auto-renew of a subscription

kenansd
Contributor
Contributor
I'm integrating Paypal Subscriptions. We would like to offer the ability for a user to disable auto-renew of their subscription and then later re-enable auto-renew if they desire. For example, a user subscribes to be billed monthly, they then disable auto-renew and continue to have access to our service. If they don't re-enable auto-renew then the subscription will expire at the end of the billing month, and if they do re-enable auto-renew then the subscription will continue.

The Paypal Subscription API offers the ability to Cancel or Suspend a subscription. If you cancel a subscription, it is a hard cancel and the user is unable to re-enable without creating a new subscription. Suspending a subscription is not appropriate for our use case, as we don't want to provide months without billing.

To handle our use case, we have implemented the following solution. When a subscription is created for the user, we assign total_cycles to 0 (unlimited). If the user wants to disable auto-renew get the subscription details https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get, determine the number of cycles_completed in the REGULAR tenure_type, and then update the subscription using https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get to set the total_cycles equal to the number of cycles_completed. If the user wants to enable auto-renew again, we can update the subscription again to set total_cycles back to 0. If no action is taken, then the subscription will expire at the end of the cycle, as expected.

Is this the preferred method for providing the user the ability to disable/enable auto-renew or are there other solutions?

Also if you have a free trial step and the user is in this step, and would like to disable auto-renew, how could we go about disabling the REGULAR cycle_executions? We can't set total_cycles to 0, as that is unlimited and the API does not appear to support -1 or another value indicating not to run. Currently the only solution I can think for this is to complete a hard cancel, which does not provide the ability for a user to re-enable. Are there other solutions for handling disabling auto-renew during a free trial period?
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.