Using abstracted checkout completion function #2937
Merged
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:
For the past year or so, we have used an abstracted "checkout completion" function to finish processing checkouts using the Stripe Checkout gateway. Now that this approach has been tested, this PR updates the PMPro checkout preheader code to use that abstracted (and renamed) function to use instead of having all the logic inline. The goal of this is to make the checkout flow more manageable to make a refactor easier down the road.
This also brings a couple of documentation updates and "hour" membership fixes from the inline preheader completion flow to the abstracted function.
There is also a bug where the $order->discount_code property is sometimes set to the discount code string instead of the discount code object. This could break some emails and is fixed in this PR.
Finally, the abstracted checkout completion function loses the logic to save billing address data in user meta, which is expected and the direction that we plan on moving.
How to test the changes in this Pull Request:
Checkouts have been tested with the free gateway, on-site Stripe, Stripe Checkout, and PayPal Express. For the paid tests, a discount code was used with all of them.
Other information:
Changelog entry