-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
#197 if event began already and has only offline payment method then … #262
#197 if event began already and has only offline payment method then … #262
Conversation
…ethod then display warning message at event show-event page and disable forward button to reservation/payment page. if even began already and has multiple payment method including offline payment then not show offline payment as option in reservation page
Thank you @Praitheesh , I'll have a look 👍 |
4 similar comments
@syjer have you got chance to look into this PR ? |
Hi @Praitheesh , sorry for taking so much time, we were quite busy. Globally it seems ok, I'll try to merge it this week 👍 |
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.
Thank you for submitting this PR!
OrderSummary orderSummary = ticketReservationManager.orderSummaryForReservationId(reservationId, event, locale); | ||
List<PaymentProxy> activePaymentMethods = paymentManager.getPaymentMethods(event.getOrganizationId()) | ||
.stream() | ||
.filter(p -> p.isActive() && event.getAllowedPaymentProxies().contains(p.getPaymentProxy())) | ||
.filter(p -> p.isActive() && event.getAllowedPaymentProxies().contains(p.getPaymentProxy()) && !p.getPaymentProxy().equals(PaymentProxy.OFFLINE) || (p.getPaymentProxy().equals(PaymentProxy.OFFLINE) && p.isActive() && event.getAllowedPaymentProxies().contains(p.getPaymentProxy()) && TicketReservationManager.hasValidOfflinePaymentWaitingPeriod(event, configurationManager))) |
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.
Could we simplify this condition?
I was thinking something like:
p -> p.isActive() && event.getAllowedPaymentProxies().contains(p.getPaymentProxy()) && (!p.getPaymentProxy().equals(PaymentProxy.OFFLINE) || TicketReservationManager.hasValidOfflinePaymentWaitingPeriod(event, configurationManager)))
would that work?
In any case I think we could extract this filter in a method, so that the code would be more readable. WDYT?
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.
Yes agree.
@@ -307,6 +307,7 @@ show-event.sold-out.message=Subscribe to the waiting queue and we''ll inform you | |||
show-event.sold-out.subscribe=subscribe | |||
show-event.sold-out.subscription-complete=Thank you for joining the waiting queue. We''ll keep you posted! | |||
show-event.sold-out.subscription-error=Something went wrong, please retry in few minutes. Thank you! | |||
show-event.offline-payment-not-available=We''re sorry, Cannot confirm an offline reservation after event start. |
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.
I would change this to a more generic: "Due to a wrong configuration, it''s not possible to sell tickets right now. Please contact the organizers." or something like that.
Could you please add the placeholders also for other languages?
E.g. in public_it.properties:
show-event.offline-payment-not-available=IT-Due to a wrong configuration, it''s not possible to sell tickets right now. Please contact the organizers.
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.
done.
@@ -220,6 +221,7 @@ public String showEvent(@PathVariable("eventName") String eventName, | |||
List<SaleableTicketCategory> validCategories = ticketCategories.stream().filter(tc -> !tc.getExpired()).collect(Collectors.toList()); | |||
List<SaleableAdditionalService> additionalServices = additionalServiceRepository.loadAllForEvent(event.getId()).stream().map((as) -> getSaleableAdditionalService(event, locale, as, promoCodeDiscount.orElse(null))).collect(Collectors.toList()); | |||
Predicate<SaleableTicketCategory> waitingQueueTargetCategory = tc -> !tc.getExpired() && !tc.isBounded(); | |||
boolean inValidOfflinePayment = event.getAllowedPaymentProxies().size() == 1 && event.getAllowedPaymentProxies().contains(PaymentProxy.OFFLINE) && !TicketReservationManager.hasValidOfflinePaymentWaitingPeriod(event, configurationManager); |
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.
could we maybe generalize this so that it could disable the button and show the warning also if there is no payment proxy available, but only if the event is not free of charge?
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.
Good point. I'll add additional check. Thanks.
…update warning message
3 similar comments
merged. Thank you! 👍 |
if event began already and has only offline payment method then display warning message at event show-event page and disable forward button to reservation/payment page.
if even began already and has multiple payment method including offline payment then not show offline payment as option in reservation page