Skip to content

Commit

Permalink
Merge branch 'develop' into feature/JAPANIZE
Browse files Browse the repository at this point in the history
* develop: (23 commits)
  alfio-event#286 mollie payment support: add new status for ticket reservation, initial stubs for user facing page
  alfio-event#286 mollie payment support: add initial stubs for handling the webhook
  alfio-event#286 mollie payment support: add initial stubs for handling the webhook
  alfio-event#286 mollie: enable only when EUR is used as currency
  alfio-event#286 initial steps for supporting mollie: create a payment + redirect
  alfio-event#286 initial stubs for supporting mollie as a payment provider
  alfio-event#286 initial stubs for supporting mollie as a payment provider
  restore snapshot version
  fix dockerfile
  fix alfio-event#297 - enable "save" button for PDF resources
  update changelog
  fix alfio-event#298
  fix alfio-event#298
  update snapshot version
  fix alfio-event#297 - enable "save" button for PDF resources
  update changelog
  [Gradle Release Plugin] - new version commit:  '1.12-SNAPSHOT'.
  [Gradle Release Plugin] - pre tag commit:  '1.11'.
  improve "cancel reservation" layout
  fix typo
  ...
  • Loading branch information
ui2-narita committed Jun 7, 2017
2 parents 87bb492 + 471ccfc commit 7f1f5db
Show file tree
Hide file tree
Showing 37 changed files with 411 additions and 100 deletions.
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Change Log

## [1.11](https://github.com/exteso/alf.io/tree/1.11) (2017-06-01)
[Full Changelog](https://github.com/exteso/alf.io/compare/1.10.2...1.11)

**Implemented enhancements:**

- Support partial refund [\#280](https://github.com/exteso/alf.io/issues/280)
- Promo code at organization level [\#291](https://github.com/exteso/alf.io/issues/291)
- Improve UI/UX of admin [\#282](https://github.com/exteso/alf.io/issues/282)
- VAT management for EU [\#278](https://github.com/exteso/alf.io/issues/278)
- notify organizer of expiring pending payments [\#277](https://github.com/exteso/alf.io/issues/277)
- Display pending reservations in the event detail [\#244](https://github.com/exteso/alf.io/issues/244)
- Support passbook when sending ticket [\#214](https://github.com/exteso/alf.io/issues/214)
- support refund [\#208](https://github.com/exteso/alf.io/issues/208)
- Add a remove ticket function [\#114](https://github.com/exteso/alf.io/issues/114)
- add more caching for uploaded file [\#58](https://github.com/exteso/alf.io/issues/58)

**Fixed bugs:**

- Billing Address remains also if inserting a VAT number [\#295](https://github.com/exteso/alf.io/issues/295)
- Remove ticket confirmation panel shows firstname instead of lastname [\#294](https://github.com/exteso/alf.io/issues/294)
- I need an invoice not working for "Outside EU" [\#293](https://github.com/exteso/alf.io/issues/293)
- Additional option are calculated wrong [\#292](https://github.com/exteso/alf.io/issues/292)

**Closed issues:**

- Backend Android App Unexpected Error [\#283](https://github.com/exteso/alf.io/issues/283)
- better user handling [\#289](https://github.com/exteso/alf.io/issues/289)
- send reservation notification to multiple addresses [\#285](https://github.com/exteso/alf.io/issues/285)
- Update contact data/billing address [\#275](https://github.com/exteso/alf.io/issues/275)
- Implement auditing [\#135](https://github.com/exteso/alf.io/issues/135)
- Support additional items [\#111](https://github.com/exteso/alf.io/issues/111)

**Merged pull requests:**

- Dutch lang update [\#296](https://github.com/exteso/alf.io/pull/296) ([mg-1999](https://github.com/mg-1999))
- \#247 feedback message added for configuration save action [\#272](https://github.com/exteso/alf.io/pull/272) ([Praitheesh](https://github.com/Praitheesh))

## [1.10.2](https://github.com/exteso/alf.io/tree/1.10.2) (2017-04-10)
[Full Changelog](https://github.com/exteso/alf.io/compare/1.10.1...1.10.2)

**Fixed bugs:**

- Cannot confirm a reservation after updating contact data from admin [\#271](https://github.com/exteso/alf.io/issues/271)
- does not generate the invoice when using the combination: admin: create reservation + offline payment [\#270](https://github.com/exteso/alf.io/issues/270)

**Closed issues:**

- Updating to latest release [\#273](https://github.com/exteso/alf.io/issues/273)
- MediaStreamTrack.getSources\(\) is deprecated and removed from Chrome [\#265](https://github.com/exteso/alf.io/issues/265)
- Alf.io-1.10 - Error running in Eclipse [\#263](https://github.com/exteso/alf.io/issues/263)

**Merged pull requests:**

- \#197 if event began already and has only offline payment method then … [\#262](https://github.com/exteso/alf.io/pull/262) ([Praitheesh](https://github.com/Praitheesh))

## [1.10.1](https://github.com/exteso/alf.io/tree/1.10.1) (2017-03-13)
[Full Changelog](https://github.com/exteso/alf.io/compare/1.10...1.10.1)

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ext {
datasourceValidationQuery = 'SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS'
//springProfilesActive = 'dev,debug-csp' //enable csp report. FIXME For some reasons it doesn't work on Chrome
springProfilesActive = 'dev'
baseImage = "ubuntu"
baseImage = "openjdk:jdk-alpine"
port = "8080"


Expand All @@ -101,15 +101,15 @@ ext {
datasourceUsername = 'root'
datasourcePassword = ''
datasourceValidationQuery = 'SELECT 1'
break;
break
case 'docker-test':
datasourceDialect = 'PGSQL'
datasourceDriver = 'org.postgresql.Driver'
datasourceUrl = 'jdbc:postgresql://0.0.0.0:5432/postgres'
datasourceUsername = 'postgres'
datasourcePassword = 'postgres'
datasourceValidationQuery = 'SELECT 1'
break;
break
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue, 07 Apr 2015 22:45:24 +0200
group=alfio
version=1.11-SNAPSHOT
version=1.12-SNAPSHOT

sourceCompatibility=1.8
targetCompatibility=1.8
Expand Down
23 changes: 5 additions & 18 deletions src/main/dist/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,14 @@
# Pull base image.
FROM @BASE_IMAGE@

# Install Java.
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

COPY ./@APP_NAME@-@[email protected] /@APP_NAME@/
COPY ./@APP_NAME@-@[email protected] /alf.io/

# Define working directory.
WORKDIR /@APP_NAME@
RUN mkdir /@APP_NAME@/logs
WORKDIR /alf.io
RUN mkdir /alf.io/logs

VOLUME ["/@APP_NAME@/logs"]
VOLUME ["/alf.io/logs"]

ENTRYPOINT ["java", "-jar", "/@APP_NAME@/@APP_NAME@-@[email protected]"]
ENTRYPOINT ["java", "-jar", "/alf.io/@APP_NAME@-@[email protected]"]

EXPOSE @PORT@
2 changes: 1 addition & 1 deletion src/main/java/alfio/config/SpringBootInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer() {
mimeMappings.put("svg", "image/svg+xml");
container.setSessionTimeout(2, TimeUnit.HOURS);
container.setMimeMappings(new MimeMappings(mimeMappings));
container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404-not-found"), new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500-internal-server-error"), new ErrorPage("/session-expired"));
//container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/404-not-found"), new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500-internal-server-error"), new ErrorPage("/session-expired"));

Optional.ofNullable(System.getProperty("alfio.worker.name")).ifPresent(workerName -> {
((JettyEmbeddedServletContainerFactory)container).addServerCustomizers(server -> {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/alfio/config/support/PlatformProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,21 +220,21 @@ private URI resolveURI(Environment env) {

@Override
public String getUrl(Environment env) {
String dbHost = Objects.requireNonNull(System.getenv("DB_PORT_5432_TCP_ADDR"), "DB_PORT_5432_TCP_ADDR env variable is missing");
String port = Objects.requireNonNull(System.getenv("DB_PORT_5432_TCP_PORT"), "DB_PORT_5432_TCP_PORT env variable is missing");
String dbName = Objects.requireNonNull(System.getenv("DB_ENV_POSTGRES_DB"), "DB_ENV_POSTGRES_DB env variable is missing");
String dbHost = Objects.requireNonNull(System.getenv("POSTGRES_PORT_5432_TCP_ADDR"), "DB_PORT_5432_TCP_ADDR env variable is missing");
String port = Objects.requireNonNull(System.getenv("POSTGRES_PORT_5432_TCP_PORT"), "DB_PORT_5432_TCP_PORT env variable is missing");
String dbName = Objects.requireNonNull(System.getenv("POSTGRES_ENV_POSTGRES_DB"), "DB_ENV_POSTGRES_DB env variable is missing");
return "jdbc:postgresql://" + dbHost + ":" + port + "/" + dbName;
}

@Override
public String getUsername(Environment env) {
return Objects.requireNonNull(System.getenv("DB_ENV_POSTGRES_USERNAME"), "DB_ENV_POSTGRES_USERNAME env variable is missing");
return Objects.requireNonNull(System.getenv("POSTGRES_ENV_POSTGRES_USERNAME"), "DB_ENV_POSTGRES_USERNAME env variable is missing");
}


@Override
public String getPassword(Environment env) {
return Objects.requireNonNull(System.getenv("DB_ENV_POSTGRES_PASSWORD"), "DB_ENV_POSTGRES_PASSWORD env variable is missing");
return Objects.requireNonNull(System.getenv("POSTGRES_ENV_POSTGRES_PASSWORD"), "DB_ENV_POSTGRES_PASSWORD env variable is missing");
}

@Override
Expand All @@ -250,7 +250,7 @@ public String getDriveClassName(Environment env) {

@Override
public boolean isHosting(Environment env) {
return ofNullable(env.getProperty("DB_ENV_POSTGRES_DB")).isPresent();
return ofNullable(System.getenv("POSTGRES_ENV_POSTGRES_DB")).isPresent();
}
},

Expand Down
34 changes: 30 additions & 4 deletions src/main/java/alfio/controller/ReservationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ public String showPaymentPage(@PathVariable("eventName") String eventName,
Map<String, Object> modelMap = model.asMap();
modelMap.putIfAbsent("paymentForm", PaymentForm.fromExistingReservation(reservation));
modelMap.putIfAbsent("hasErrors", false);

boolean hasPaidSupplement = ticketReservationManager.hasPaidSupplements(reservationId);
model.addAttribute(
"ticketsByCategory",
ticketsInReservation.stream().collect(Collectors.groupingBy(Ticket::getCategoryId)).entrySet().stream()
.map((e) -> {
TicketCategory category = eventManager.getTicketCategoryById(e.getKey(), event.getId());
List<TicketDecorator> decorators = TicketDecorator.decorate(e.getValue(),
configurationManager.getBooleanConfigValue(Configuration.from(event.getOrganizationId(), event.getId(), category.getId(), ALLOW_FREE_TICKETS_CANCELLATION), false),
!hasPaidSupplement && configurationManager.getBooleanConfigValue(Configuration.from(event.getOrganizationId(), event.getId(), category.getId(), ALLOW_FREE_TICKETS_CANCELLATION), false),
eventManager.checkTicketCancellationPrerequisites(),
ticket -> ticketHelper.findTicketFieldConfigurationAndValue(event.getId(), ticket, locale),
true, (t) -> "tickets['"+t.getUuid()+"'].");
Expand Down Expand Up @@ -213,14 +215,14 @@ public String showConfirmationPage(@PathVariable("eventName") String eventName,
.stream()
.map(t -> Triple.of(t.getLeft(), t.getMiddle().stream().filter(d -> d.getLocale().equals(locale.getLanguage())).collect(toList()), t.getRight()))
.collect(Collectors.toList());

boolean hasPaidSupplement = ticketReservationManager.hasPaidSupplements(reservationId);
model.addAttribute(
"ticketsByCategory",
tickets.stream().collect(Collectors.groupingBy(Ticket::getCategoryId)).entrySet().stream()
.map((e) -> {
TicketCategory category = eventManager.getTicketCategoryById(e.getKey(), ev.getId());
List<TicketDecorator> decorators = TicketDecorator.decorate(e.getValue(),
configurationManager.getBooleanConfigValue(Configuration.from(ev.getOrganizationId(), ev.getId(), category.getId(), ALLOW_FREE_TICKETS_CANCELLATION), false),
!hasPaidSupplement && configurationManager.getBooleanConfigValue(Configuration.from(ev.getOrganizationId(), ev.getId(), category.getId(), ALLOW_FREE_TICKETS_CANCELLATION), false),
eventManager.checkTicketCancellationPrerequisites(),
ticket -> ticketHelper.findTicketFieldConfigurationAndValue(ev.getId(), ticket, locale),
tickets.size() == 1, TicketDecorator.EMPTY_PREFIX_GENERATOR);
Expand Down Expand Up @@ -342,6 +344,14 @@ public String showWaitingPaymentPage(@PathVariable("eventName") String eventName
return redirectReservation(reservation, eventName, reservationId);
}

@RequestMapping(value = "/event/{eventName}/reservation/{reservationId}/waitingPayment", method = RequestMethod.GET)
public String showProcessingPayment(@PathVariable("eventName") String eventName,
@PathVariable("reservationId") String reservationId,
Model model, Locale locale) {

//FIXME
return "/event/reservation-processing-payment";
}


private String redirectReservation(Optional<TicketReservation> ticketReservation, String eventName, String reservationId) {
Expand All @@ -358,6 +368,8 @@ private String redirectReservation(Optional<TicketReservation> ticketReservation
return baseUrl + "/success";
case OFFLINE_PAYMENT:
return baseUrl + "/waitingPayment";
case EXTERNAL_PROCESSING_PAYMENT:
return baseUrl + "/processing-payment";
case IN_PAYMENT:
case STUCK:
return baseUrl + "/failure";
Expand Down Expand Up @@ -418,8 +430,22 @@ public String handleReservation(@PathVariable("eventName") String eventName,
return redirectReservation(ticketReservation, eventName, reservationId);
}
}
//

//handle mollie redirect
if(paymentForm.getPaymentMethod() == PaymentProxy.MOLLIE) {
OrderSummary orderSummary = ticketReservationManager.orderSummaryForReservationId(reservationId, event, locale);
try {
String checkoutUrl = paymentManager.createMollieCheckoutRequest(event, reservationId, orderSummary, customerName,
paymentForm.getEmail(), paymentForm.getBillingAddress(), locale, paymentForm.isPostponeAssignment());
assignTickets(eventName, reservationId, paymentForm, bindingResult, request, true);
return "redirect:" + checkoutUrl;
} catch (Exception e) {
bindingResult.reject(ErrorsCode.STEP_2_PAYMENT_REQUEST_CREATION);
SessionUtil.addToFlash(bindingResult, redirectAttributes);
return redirectReservation(ticketReservation, eventName, reservationId);
}
}
//

final PaymentResult status = ticketReservationManager.confirm(paymentForm.getToken(), paymentForm.getPaypalPayerID(), event, reservationId, paymentForm.getEmail(),
customerName, locale, paymentForm.getBillingAddress(), reservationCost, SessionUtil.retrieveSpecialPriceSessionId(request),
Expand Down
Loading

0 comments on commit 7f1f5db

Please sign in to comment.