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

Now sending users to Stripe Checkout during the process method #3104

Merged

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Previously, we had to send users to Stripe Checkout on the pmpro_checkout_before_change_membership_level hook since user objects would not exist during the gateway's process() method. Now, however, users are created before payments are taken.

Currently, if sending a user to Stripe Checkout fails (due to not being able to connect to Stripe, for example), the checkout will complete successfully without collecting payment. Switching to using the process() method allows us to halt checkout on these errors and show a relevant error message at checkout.

The easiest way to replicate is to set up a local dev environment and check out with Stripe Checkout with your machine's wifi disabled.

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
Copy link
Member Author

This should wait for a minor release in case custom code is calling our Stripe gateway's pmpro_checkout_before_change_membership_level() method. This is extremely unlikely, but technically breaking

@dparker1005 dparker1005 added this to the 3.2 milestone Aug 1, 2024
@dparker1005 dparker1005 changed the base branch from dev to v3.2 August 1, 2024 16:10
Copy link
Contributor

@andrewlimaza andrewlimaza left a comment

Choose a reason for hiding this comment

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

This works out well, thanks David!

@dparker1005 dparker1005 merged commit f855aba into strangerstudios:v3.2 Aug 20, 2024
@dparker1005 dparker1005 deleted the stripe-checkout-during-process branch August 20, 2024 14:12
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