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

Prevent duplicated orders and attendees as a result #3470

Closed

Conversation

dpanta94
Copy link
Member

@dpanta94 dpanta94 commented Jan 6, 2025

🎫 Ticket

ET-2279

πŸ—’οΈ Description

Description in video: https://www.loom.com/share/43b3d371066c40a2b4c341e63044c8aa

πŸŽ₯ Artifacts

Solution in video: https://www.loom.com/share/9342174d6cee48efaf7a4d3bec06abff

βœ”οΈ Checklist

  • Ran npm run changelog to add changelog file(s). More info here
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

@dpanta94 dpanta94 self-assigned this Jan 6, 2025
@dpanta94 dpanta94 added the code review Status: requires a code review. label Jan 6, 2025
@dpanta94 dpanta94 requested a review from a team January 6, 2025 12:38
@dpanta94 dpanta94 marked this pull request as ready for review January 6, 2025 13:04
Copy link
Contributor

@stratease stratease left a comment

Choose a reason for hiding this comment

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

Bit of a design change.

src/Tickets/Commerce/Order.php Outdated Show resolved Hide resolved
src/Tickets/Commerce/Order.php Outdated Show resolved Hide resolved
src/Tickets/Commerce/Order.php Outdated Show resolved Hide resolved
src/Tickets/Commerce/Order.php Outdated Show resolved Hide resolved
src/Tickets/Commerce/Order.php Outdated Show resolved Hide resolved
src/Tickets/Commerce/Abstract_Order.php Show resolved Hide resolved
Comment on lines +475 to +484
if ( ! empty( $args['email'] ) ) {
$update_args['email'] = $args['email'];
}

if (
empty( $args['email'] )
&& ! empty( $order->purchaser['email'] )
) {
$update_args['email'] = $order->purchaser['email'];
}
Copy link
Member

Choose a reason for hiding this comment

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

Should this be an elseif?
i.e.
if ( ! empty( $args['email'] ) ) { ... }
if ( empty( $args['email'] ) && ...

Copy link
Member

Choose a reason for hiding this comment

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

root question - do we want to do both in order, or just one?

Comment on lines +486 to +494
if ( ! empty( $args['full_name'] ) ) {
$update_args['full_name'] = $args['full_name'];
$update_args['title'] = $args['full_name'];
}

if (
empty( $args['full_name'] )
&& ! empty( $order->purchaser['full_name'] )
) {
Copy link
Member

Choose a reason for hiding this comment

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

Another potential elseif.

Comment on lines +131 to +132
}
$existing[] = $attendee_id;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
}
$existing[] = $attendee_id;
}
$existing[] = $attendee_id;

Comment on lines +550 to +553
$gateway_key = $gateway::get_key();

$existing_order_id = (int) $args['id'] ?? 0;
unset( $args['id'] );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$gateway_key = $gateway::get_key();
$existing_order_id = (int) $args['id'] ?? 0;
unset( $args['id'] );
$gateway_key = $gateway::get_key();
$existing_order_id = (int) $args['id'] ?? 0;
unset( $args['id'] );

@Camwyn Camwyn deleted the branch release/T24.hydra.1 January 7, 2025 18:50
@Camwyn Camwyn closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code review Status: requires a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants