Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhauling the PPE review/confirmation process #3116

Merged

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Currently, our PayPal Express integration relies heavily on the existing checkout preheader flow and checkout page template. This reliance complicates updates to the checkout flow, as PPE functions differently from other gateways. The main issues are:
• Use of the pmpro_checkout_confirmed hook to modify data in the checkout preheader during processing.
• Dependency on the review order status and the $pmpro_review global variable throughout the checkout preheader and page template.

This PR addresses these issues with the following changes:

Deprecation of pmpro_checkout_confirmed Hook:

The pmpro_checkout_confirmed hook is deprecated. Its logic is now handled using the pmpro_checkout_preheader hook and the gateway class’ process() method. These are the preferred hooks for future gateway integrations.

Enhanced Use of $pmpro_review Variable:

Instead of eliminating the $pmpro_review variable, this PR leverages it further. The goal is to eventually separate the payment step from the rest of the checkout process, showing only payment fields while hiding account fields and other checkout boxes.

The $pmpro_review variable can now store a MemberOrder object, representing a pending order where payment has not yet been completed. When a token order is passed into the checkout preheader and assigned to $pmpro_review, only the payment fields are displayed at checkout. Currently, this functionality is specific to PPE in the checkout page template but sets the stage for broader use across all gateways.

Backward-Compatibility and Future Vision:

Importantly, these changes do not alter the checkout page template, ensuring backward compatibility with existing custom templates. This allows for inclusion in a minor PMPro release. Further updates to the checkout page template could then enable new “multi-step payment” gateways in subsequent minor releases.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

@dparker1005 dparker1005 added this to the 3.2 milestone Aug 8, 2024
@dparker1005 dparker1005 merged commit b19a2e2 into strangerstudios:v3.2 Aug 20, 2024
@dparker1005 dparker1005 deleted the ppe-overhaul-confirmations branch August 20, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant