Supporting setting profile start date on checkout level #3233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Profile start dates are currently calculated and filtered when creating a subscription at the payment gateway. Although this works well for the vast majority of use cases, it gets complicated when custom code wants to adjust the billing amount and set a profile start date at the same time (for example, prorations).
This PR adds a support for a new
profile_start_date
property on the checkout level object that can be adjusted during thepmpro_checkout_level
filter. This makes adjusting theprofile_start_date
at checkout the same process as any other level property.This PR will also begin throwing deprecation warnings for the existing
pmpro_profile_start_date
filter to encourage developers to usepmpro_checkout_level
. This will ensure that everyone is adjusting the profile start date in the same way and will allow us to remove thepmpro_profile_start_date
filter in a future update.Other information:
Changelog entry