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

Using abstracted checkout completion function #2937

Conversation

dparker1005
Copy link
Member

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:

  • 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.1 milestone Jun 4, 2024
@dparker1005 dparker1005 changed the base branch from dev to v3.1 July 3, 2024 16:28
Copy link
Member

@ideadude ideadude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments/questions. Great stuff. I'm doing a few more tests and will let you know how they go.

preheaders/checkout.php Outdated Show resolved Hide resolved
includes/checkout.php Show resolved Hide resolved
preheaders/checkout.php Outdated Show resolved Hide resolved
@dparker1005 dparker1005 merged commit 223b7a8 into strangerstudios:v3.1 Jul 3, 2024
@dparker1005 dparker1005 deleted the checkout-preheader-abstract-completion branch July 5, 2024 13:49
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.

None yet

2 participants