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

#197 if event began already and has only offline payment method then … #262

Merged
merged 2 commits into from
Apr 8, 2017

Conversation

Praitheesh
Copy link
Contributor

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

…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
@syjer
Copy link
Member

syjer commented Feb 17, 2017

Thank you @Praitheesh , I'll have a look 👍

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 53.903% when pulling bcb60a3 on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 53.903% when pulling bcb60a3 on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@coveralls
Copy link

coveralls commented Feb 17, 2017

Coverage Status

Coverage decreased (-0.007%) to 53.903% when pulling bcb60a3 on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 53.903% when pulling bcb60a3 on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 53.903% when pulling bcb60a3 on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@Praitheesh
Copy link
Contributor Author

@syjer have you got chance to look into this PR ?

@syjer
Copy link
Member

syjer commented Mar 15, 2017

Hi @Praitheesh , sorry for taking so much time, we were quite busy. Globally it seems ok, I'll try to merge it this week 👍

Copy link
Member

@cbellone cbellone left a 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)))
Copy link
Member

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?

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor Author

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);
Copy link
Member

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?

Copy link
Contributor Author

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.

@coveralls
Copy link

coveralls commented Apr 8, 2017

Coverage Status

Coverage increased (+0.07%) to 53.981% when pulling f5145ca on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 53.981% when pulling f5145ca on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 53.981% when pulling f5145ca on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 53.981% when pulling f5145ca on Praitheesh:197_after_event_start_error into 72d8e0e on exteso:master.

@cbellone cbellone merged commit a7708dd into alfio-event:master Apr 8, 2017
@cbellone
Copy link
Member

cbellone commented Apr 8, 2017

merged. Thank you! 👍

@Praitheesh Praitheesh deleted the 197_after_event_start_error branch April 8, 2017 09:00
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.

None yet

4 participants