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

Do not create recurring orders if last payment was from another gateway #115

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Fixed issue in PMPro v3.0+ where recurring orders could be created for old Check orders even if the last payment was from a different payment gateway.

This means that if a user paid by check and then switched to paying with Stripe, recurring check orders could still be created in pending status and, if not marked as success, the user's membership could be canceled.

The change in PMPro v3.0 that brought about this issue was the removal of the cancelled status. The query fix by this PR only looks for orders in pending or success status to create a recurring order for, and since orders for old memberships were in cancelled status previously, recurring orders would not be created for them. Now that all cancelled orders are now success, this safeguard no longer works.

The fix in this PR changes the query to say "Only create recurring order if there is an old Check order that does not have orders from ANY gateway following it".

The fact that all orders are now success means that this query is now a lot less performant. We want to update this Add On to utilize Subs Table ASAP to both fix edge cases and improve performance.

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 merged commit a0a92ba into strangerstudios:dev Mar 28, 2024
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