strangerstudios / pmpro-cancel-on-next-payment-date

Change membership cancellation in Paid Memberships Pro to set expiration for next payment date instead of cancelling immediately.
https://www.paidmembershipspro.com/add-ons/cancel-on-next-payment-date
8 stars 8 forks source link

Bypass when we dont know which is the level being cancelled #34

Closed mircobabini closed 1 year ago

mircobabini commented 2 years ago

All Submissions:

Changes proposed in this Pull Request:

Resolves #33.

How to test the changes in this Pull Request:

  1. Enable some log to check when this update fails: https://github.com/strangerstudios/pmpro-cancel-on-next-payment-date/blob/e62e9d5c68dfa3b2540b0066eccf15b6fe5989ba/pmpro-cancel-on-next-payment-date.php#L138
  2. Call pmpro_changeMembershipLevel(0, get_current_user_id(), 'cancelled', NULL)

After applying the patch, that function will bail as soon as possible

Other information: