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

Force unconfirmed tickets to log in. #1421

Open
wants to merge 6 commits into
base: production
Choose a base branch
from

Conversation

StevenDufresne
Copy link
Contributor

@StevenDufresne StevenDufresne commented Oct 30, 2024

Fixes #1420

Props mkrndmane, ryelle.

This PR forces login for editing tickets that are currently unconfirmed.

Changes

  • Adds user_must_confirm_ticket that checks if the ticket is unconfirmed. Reference
  • Passes along all tix_ parameters found in $_REQUEST to the final destination. Reference
    • I don't understand is why the original code checked for isset( $_REQUEST['tix_tickets_selected'] ) before passing along the parameters. I would assume we could pass them along in all cases.

How to test

  1. Purchase multiple tickets. (Stripe test cards, Stripe test keys)
    • Set a ticket to I don't know who will use this ticket yet
    • Set a ticket First Name/Last Name/Email.
  2. While viewing an Attendees post through the admin interface list:
    • Confirm the tix_username is set to [[ unconfirmed ]]
    • Copy the edit token link address.
  3. Visit that link in an incognito session.
  4. Confirm you are asked to login.
    • Note if you login with the same account you purchased your ticket with, this filter will stop you. You can comment out this one and the one below it to test if you don't have a second account to use
  5. Enter new details into the fields.
  6. Click the "Confirm Registration" button.
  7. View the attendee through the admin interface and confirm that their tix_username is set to the user that was used to log in.
  8. Copy the edit token link again.
  9. Log out.
  10. Paste that link in your browser.
  11. Update information and click "Save Attendee information"
  12. Notice that you are able to update the ticket information without logging in once the user is no longer [[ unconfirmed ]].

@StevenDufresne StevenDufresne marked this pull request as ready for review October 30, 2024 05:19
@pkevan
Copy link
Contributor

pkevan commented Oct 31, 2024

Unsure if this has been tested, but could this logic be extended to support users transferring their tickets to another username? Or is that supported elsewhere? I suppose on transfer of a ticket, it would just switch back to [[ unconfirmed ]]

@ryelle
Copy link
Contributor

ryelle commented Oct 31, 2024

I don't understand is why the original code checked for isset( $_REQUEST['tix_tickets_selected'] ) before passing along the parameters. I would assume we could pass them along in all cases.

Pretty sure that was just because I used $_REQUEST['tix_tickets_selected'] right below and wanted to make sure it wouldn't error.

I've tested out the edit ticket flow and a logged out user can correctly edit a ticket bought before the require-login, and not edit after 👍🏻

Unfortunately, in testing the regular ticket purchase flow I'm seeing this error:

Screenshot 2024-10-31 at 3 20 18 PM

I also realized the current redirect probably doesn't pass through the reservation info, but I was interrupted by ^ before I could properly test. A reservation is set up on a ticket (in the edit-ticket screen), and ends up being a link like somecamp.wordcamp.org/2024/tickets/?tix_reservation_id=speakers&tix_reservation_token=k3vlopd1G3vWewZA.

@ryelle
Copy link
Contributor

ryelle commented Oct 31, 2024

Oh, the error is because tix_tickets_selected should be an array of [ticket-id] => quantity, not an int.

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.

Editing unconfirmed tickets clears the username.
3 participants