Skip to content

Email admins if group code used multiple times #12

@dparker1005

Description

@dparker1005

Is your feature request related to a problem? Please describe.
In #11, we are no longer counting a group code as "used" until an order is completed with that code. This can cause issues when, for example, multiple users try to check out for the code with Stripe Checkout at the same time. Since the code is not considered used until the checkout is complete, both users could get to Stripe Checkout using the same group code as long as neither checkout has yet been completed.

Describe the solution you'd like
Since there isn't a great way to prevent this issue from happening, we should try to notify administrators when it does. This can be done in the pmpro_groupcodes_pmpro_discount_code_used() function by first checking if there is already an order ID for the group code and, if so, emailing the admin so that they are aware of the issue and can sort it out on their end.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions