Skip to content

Commit

Permalink
feat(#109): translation for sepa page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 19, 2023
1 parent ac64741 commit 581d91d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/java/org/eurofurence/regsys/web/pages/SepaPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class SepaPage extends Page {

private String refId = "";
private String subject = "";
private String language = "en-US";
private boolean showInfo = false;
private Transaction transaction = new Transaction();
private final PaymentService paymentService = new PaymentService();
Expand Down Expand Up @@ -119,6 +120,11 @@ public boolean mayView() {
return showInfo;
}

@SuppressWarnings("unused")
public String getLanguage() {
return language;
}

// form
@SuppressWarnings("unused")
public String getFormHeader() {
Expand Down Expand Up @@ -171,14 +177,18 @@ public String handleRequest() throws ServletException {
if (status == Constants.MemberStatus.APPROVED || status == Constants.MemberStatus.PARTIALLY_PAID) {
Attendee me = getLoggedInAttendee();

if ("de-DE".equals(me.registrationLanguage)) {
language = "de-DE";
}

refId = getRequest().getParameter(TRANSACTION);
if (refId == null || "".equals(refId)) {
throw new DbDataException(Strings.sepaPage.transactionNotFound);
}

logger.info("reading transaction " + refId);

TransactionResponse response = paymentService.performFindTransactions(null, refId, null, null, getTokenFromRequest(), getRequestId());
TransactionResponse response = paymentService.performFindTransactions(me.id, refId, null, null, getTokenFromRequest(), getRequestId());
if (response == null || response.payload == null || response.payload.size() != 1) {
throw new DbDataException(Strings.sepaPage.transactionNotFound);
}
Expand Down
56 changes: 56 additions & 0 deletions src/tpl/common/pages/sepa.vm
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
#if($page.Language == "de-DE")
<td class="contentbox">
<div class="pageheader">&Uuml;berweisungsinformationen</div>
<hr class="contentbox">

#parse( "errorlisting.vm" )

#if($page.mayView())##
<div class="headline">Zahlung per SEPA Bank&uuml;berweisung</div>
<hr class="contentbox">
$page.FormHeader
<TABLE>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">Kontoinhaber</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.AccountOwner</TD>
</TR>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">Bank</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.BankName</TD>
</TR>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">Addresse</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.BankAddress</TD>
</TR>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">IBAN</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.Iban</TD>
</TR>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">BIC</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.Bic</TD>
</TR>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">Betrag</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.Amount</TD>
</TR>
<TR>
<TD class="label" ALIGN="right" VALIGN="middle">Betreff</TD>
<TD class="input" ALIGN="left" VALIGN="middle">$page.Subject</TD>
</TR>
<TR>
<TD>${page.submitBack("Zur&uuml;ck", "submit_small")}</TD>
<TD>${page.submitSent("Ich habe gezahlt!", "submit")}</TD>
</TR>
</TABLE>
$page.FormFooter
#else##
<div class="contentbox">Ein Fehler ist aufgetreten.</div><br/>
$page.FormHeader
${page.submitBack("Zur&uuml;ck", "submit_small")}
$page.FormFooter
#end##

</td>
#else
<td class="contentbox">
<div class="pageheader">SEPA Payment Information</div>
<hr class="contentbox">
Expand Down Expand Up @@ -52,3 +107,4 @@

</td>
##
#end

0 comments on commit 581d91d

Please sign in to comment.