-
Notifications
You must be signed in to change notification settings - Fork 42
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
SLR - do not clear session for incomplete orders #3335
base: feat/slr-support
Are you sure you want to change the base?
Conversation
This updates the logic used to confirm attendee reservations and clear the current seat selection session to make sure the session will not be cleared when the order is not complete (e.g. a pending one). If the session is incorrectly cleared, then the frontend timer will not find the session information and will expire sending the user a time-out message and a redirection dialog. This will happen if the user cannot complete the payment correctly after a failure (that would generate attendees and a pending order) in the grace time. Avoiding the session clear in those instances of failed payment will allow the user to try and complete the payment beyond the grace period, provided they still have time to do it.
* @return bool Whether the reservations were confirmed or not. | ||
*/ | ||
public function confirm_all_reservations(): bool { | ||
public function confirm_all_reservations(bool $delete_token_session = true): bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen
Expected 1 spaces after opening parenthesis; 0 found
* @return bool Whether the reservations were confirmed or not. | ||
*/ | ||
public function confirm_all_reservations(): bool { | ||
public function confirm_all_reservations(bool $delete_token_session = true): bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose
Expected 1 spaces before closing parenthesis; 0 found
@@ -14,6 +14,7 @@ | |||
use TEC\Common\StellarWP\Assets\Asset; | |||
use TEC\Common\StellarWP\DB\DB; | |||
use TEC\Tickets\Admin\Attendees\Page as Attendee_Page; | |||
use TEC\Tickets\Commerce\Order; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse
Type TEC\Tickets\Commerce\Order is not used in this file.
* @return void | ||
*/ | ||
public function confirm_all_reservations(): void { | ||
$this->session->confirm_all_reservations(); | ||
public function confirm_all_reservations($attendees, $ticket, $order, $new_status): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen
Expected 1 spaces after opening parenthesis; 0 found
* @return void | ||
*/ | ||
public function confirm_all_reservations(): void { | ||
$this->session->confirm_all_reservations(); | ||
public function confirm_all_reservations($attendees, $ticket, $order, $new_status): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose
Expected 1 spaces before closing parenthesis; 0 found
This updates the logic used to confirm attendee reservations and clear
the current seat selection session to make sure the session will not be
cleared when the order is not complete (e.g. a pending one).
If the session is incorrectly cleared, then the frontend timer will not
find the session information and will expire sending the user a time-out
message and a redirection dialog. This will happen if the user cannot
complete the payment correctly after a failure (that would generate
attendees and a pending order) in the grace time.
Avoiding the session clear in those instances of failed payment will
allow the user to try and complete the payment beyond the grace period,
provided they still have time to do it.
TODO: