Skip to content
Snippets Groups Projects
Commit a79d4f2e authored by srosse's avatar srosse
Browse files

OO-4203: missing currency settings in admin., translations

parent e8fd6b82
No related branches found
No related tags found
No related merge requests found
Showing
with 367 additions and 287 deletions
#Fri Mar 23 15:13:55 CET 2018 #Mon Aug 26 20:05:32 CEST 2019
bulkuserreplay.chkbx.onoff=Checkbox activ\u00E9e signifie Replay ON et AJAX OFF bulkuserreplay.chkbx.onoff=Checkbox activ\u00E9e signifie Replay ON et AJAX OFF
bulkuserreplay.tt=Nom d'utilisateur ligne par ligne (sans virgule ou similaires) bulkuserreplay.tt=Nom d'utilisateur ligne par ligne (sans virgule ou similaires)
data.no.save=Attention\: Les modifications seront perdues apr\u00E8s le red\u00E9marrage d'OLAT\! Pour enregistrer les r\u00E9glages de fa\u00E7on permanente, il faut enregistrer les modifications dans le fichier olat.properties. Dans une version future, un enregistrement automatique sera possible. data.no.save=Attention\: Les modifications seront perdues apr\u00E8s le red\u00E9marrage d'OLAT\! Pour enregistrer les r\u00E9glages de fa\u00E7on permanente, il faut enregistrer les modifications dans le fichier olat.properties. Dans une version future, un enregistrement automatique sera possible.
...@@ -62,6 +62,7 @@ menu.parent.customizing=Personnalisation ...@@ -62,6 +62,7 @@ menu.parent.customizing=Personnalisation
menu.parent.customizing.alt=Personnalisation d'OpenOlat menu.parent.customizing.alt=Personnalisation d'OpenOlat
menu.parent.maintenance=Maintenance du syst\u00E8me menu.parent.maintenance=Maintenance du syst\u00E8me
menu.parent.maintenance.alt=Maintenance du syst\u00E8me et options suppl\u00E9mentaires menu.parent.maintenance.alt=Maintenance du syst\u00E8me et options suppl\u00E9mentaires
menu.payments=Modules de paiement
menu.quota=Gestion des quotas menu.quota=Gestion des quotas
menu.quota.alt=Gestion des quotas menu.quota.alt=Gestion des quotas
menu.registration=Enregistrement du syst\u00E8me menu.registration=Enregistrement du syst\u00E8me
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
*/ */
package org.olat.resource.accesscontrol.provider.paypalcheckout; package org.olat.resource.accesscontrol.provider.paypalcheckout;
import java.util.Arrays;
import java.util.List;
import org.olat.core.configuration.AbstractSpringModule; import org.olat.core.configuration.AbstractSpringModule;
import org.olat.core.util.coordinate.CoordinatorManager; import org.olat.core.util.coordinate.CoordinatorManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -38,6 +41,31 @@ public class PaypalCheckoutModule extends AbstractSpringModule { ...@@ -38,6 +41,31 @@ public class PaypalCheckoutModule extends AbstractSpringModule {
private static final String PAYPAL_CLIENT_SECRET = "paypal.checkout.v2.client.secret"; private static final String PAYPAL_CLIENT_SECRET = "paypal.checkout.v2.client.secret";
private static final String PAYPAL_CURRENCY = "paypal.checkout.v2.currency"; private static final String PAYPAL_CURRENCY = "paypal.checkout.v2.currency";
private static final String[] currencies = new String[] {
"AUD",
"CAD",
"CZK",
"DKK",
"EUR",
"HKD",
"HUF",
"ILS",
"JPY",
"MXN",
"NOK",
"NZD",
"PHP",
"PLN",
"GBP",
"SGD",
"SEK",
"CHF",
"TWD",
"THB",
"TRY",
"USD"
};
@Value("${paypal.checkout.v2.client.id}") @Value("${paypal.checkout.v2.client.id}")
private String clientId; private String clientId;
@Value("${paypal.checkout.v2.client.secret}") @Value("${paypal.checkout.v2.client.secret}")
...@@ -82,6 +110,10 @@ public class PaypalCheckoutModule extends AbstractSpringModule { ...@@ -82,6 +110,10 @@ public class PaypalCheckoutModule extends AbstractSpringModule {
setSecretStringProperty(PAYPAL_CLIENT_SECRET, secret, true); setSecretStringProperty(PAYPAL_CLIENT_SECRET, secret, true);
} }
public List<String> getPaypalCurrencies() {
return Arrays.asList(currencies);
}
public String getPaypalCurrency() { public String getPaypalCurrency() {
return paypalCurrency; return paypalCurrency;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
package org.olat.resource.accesscontrol.provider.paypalcheckout.ui; package org.olat.resource.accesscontrol.provider.paypalcheckout.ui;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.FormItemContainer; import org.olat.core.gui.components.form.flexible.FormItemContainer;
...@@ -27,6 +28,7 @@ import org.olat.core.gui.components.form.flexible.elements.DateChooser; ...@@ -27,6 +28,7 @@ import org.olat.core.gui.components.form.flexible.elements.DateChooser;
import org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement; import org.olat.core.gui.components.form.flexible.elements.MultipleSelectionElement;
import org.olat.core.gui.components.form.flexible.elements.SingleSelection; import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
import org.olat.core.gui.components.form.flexible.elements.TextElement; import org.olat.core.gui.components.form.flexible.elements.TextElement;
import org.olat.core.gui.components.util.KeyValues;
import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.StringHelper; import org.olat.core.util.StringHelper;
...@@ -60,31 +62,6 @@ public class PaypalCheckoutAccessConfigurationController extends AbstractConfigu ...@@ -60,31 +62,6 @@ public class PaypalCheckoutAccessConfigurationController extends AbstractConfigu
private static final String[] vatKeys = new String[]{"on"}; private static final String[] vatKeys = new String[]{"on"};
private final String[] vatValues; private final String[] vatValues;
private static final String[] currencies = new String[] {
"AUD",
"CAD",
"CZK",
"DKK",
"EUR",
"HKD",
"HUF",
"ILS",
"JPY",
"MXN",
"NOK",
"NZD",
"PHP",
"PLN",
"GBP",
"SGD",
"SEK",
"CHF",
"TWD",
"THB",
"TRY",
"USD"
};
private OfferAccess link; private OfferAccess link;
@Autowired @Autowired
...@@ -123,12 +100,15 @@ public class PaypalCheckoutAccessConfigurationController extends AbstractConfigu ...@@ -123,12 +100,15 @@ public class PaypalCheckoutAccessConfigurationController extends AbstractConfigu
amount = PriceFormat.format(price.getAmount()); amount = PriceFormat.format(price.getAmount());
} }
priceEl = uifactory.addTextElement("price", "price", 32, amount, formLayout); priceEl = uifactory.addTextElement("price", "price", 32, amount, formLayout);
currencyEl = uifactory.addDropdownSingleselect("currency", "currency", formLayout, currencies, currencies, null); KeyValues currencies = new KeyValues();
List<String> paypalCurrencies = paypalModule.getPaypalCurrencies();
paypalCurrencies.forEach(currency -> currencies.add(KeyValues.entry(currency, currency)));
currencyEl = uifactory.addDropdownSingleselect("currency", "currency", formLayout, currencies.keys(), currencies.values(), null);
boolean selected = false; boolean selected = false;
if(price != null && price.getCurrencyCode() != null) { if(price != null && price.getCurrencyCode() != null) {
for(String currency:currencies) { for(String currency:paypalCurrencies) {
if(currency.equals(price.getCurrencyCode())) { if(currency.equals(price.getCurrencyCode())) {
currencyEl.select(currency, true); currencyEl.select(currency, true);
selected = true; selected = true;
......
...@@ -19,13 +19,18 @@ ...@@ -19,13 +19,18 @@
*/ */
package org.olat.resource.accesscontrol.provider.paypalcheckout.ui; package org.olat.resource.accesscontrol.provider.paypalcheckout.ui;
import java.util.List;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.FormItemContainer; import org.olat.core.gui.components.form.flexible.FormItemContainer;
import org.olat.core.gui.components.form.flexible.elements.SingleSelection;
import org.olat.core.gui.components.form.flexible.elements.TextElement; import org.olat.core.gui.components.form.flexible.elements.TextElement;
import org.olat.core.gui.components.form.flexible.impl.FormBasicController; import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
import org.olat.core.gui.components.util.KeyValues;
import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.WindowControl;
import org.olat.core.util.StringHelper;
import org.olat.resource.accesscontrol.AccessControlModule; import org.olat.resource.accesscontrol.AccessControlModule;
import org.olat.resource.accesscontrol.provider.paypalcheckout.PaypalCheckoutModule; import org.olat.resource.accesscontrol.provider.paypalcheckout.PaypalCheckoutModule;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -41,6 +46,9 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr ...@@ -41,6 +46,9 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr
private TextElement clientIdEl; private TextElement clientIdEl;
private TextElement clientSecretEl; private TextElement clientSecretEl;
private SingleSelection currencyEl;
private final List<String> paypalCurrencies;
@Autowired @Autowired
private AccessControlModule acModule; private AccessControlModule acModule;
...@@ -49,7 +57,7 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr ...@@ -49,7 +57,7 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr
public PaypalCheckoutAccountConfigurationController(UserRequest ureq, WindowControl wControl) { public PaypalCheckoutAccountConfigurationController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl); super(ureq, wControl);
paypalCurrencies = paypalModule.getPaypalCurrencies();
initForm(ureq); initForm(ureq);
} }
...@@ -66,6 +74,15 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr ...@@ -66,6 +74,15 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr
setFormDescription("checkout.config.description"); setFormDescription("checkout.config.description");
setFormContextHelp("PayPal Configuration"); setFormContextHelp("PayPal Configuration");
KeyValues currencies = new KeyValues();
paypalCurrencies.forEach(currency -> currencies.add(KeyValues.entry(currency, currency)));
currencyEl = uifactory.addDropdownSingleselect("currency", "currency", formLayout, currencies.keys(), currencies.values(), null);
if(StringHelper.containsNonWhitespace(paypalModule.getPaypalCurrency())) {
currencyEl.select(paypalModule.getPaypalCurrency(), true);
} else {
currencyEl.select("CHF", true);
}
String clientId = paypalModule.getClientId(); String clientId = paypalModule.getClientId();
clientIdEl = uifactory.addTextElement("checkout.client.id", 128, clientId, formLayout); clientIdEl = uifactory.addTextElement("checkout.client.id", 128, clientId, formLayout);
String clientSecret = paypalModule.getClientSecret(); String clientSecret = paypalModule.getClientSecret();
...@@ -85,6 +102,9 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr ...@@ -85,6 +102,9 @@ public class PaypalCheckoutAccountConfigurationController extends FormBasicContr
protected void formOK(UserRequest ureq) { protected void formOK(UserRequest ureq) {
paypalModule.setClientId(clientIdEl.getValue()); paypalModule.setClientId(clientIdEl.getValue());
paypalModule.setClientSecret(clientSecretEl.getValue()); paypalModule.setClientSecret(clientSecretEl.getValue());
if(currencyEl.isOneSelected() && paypalCurrencies.contains(currencyEl.getSelectedKey())) {
paypalModule.setPaypalCurrency(currencyEl.getSelectedKey());
}
showInfo("saved"); showInfo("saved");
} }
} }
\ No newline at end of file
...@@ -4,7 +4,7 @@ access.paypal.desc=Diese Ressource kann mit einem PayPal Konto gekauft werden. H ...@@ -4,7 +4,7 @@ access.paypal.desc=Diese Ressource kann mit einem PayPal Konto gekauft werden. H
access.paypal.title=Bezahlen mit PayPal access.paypal.title=Bezahlen mit PayPal
checkout.client.id=Client ID checkout.client.id=Client ID
checkout.client.secret=Client secret checkout.client.secret=Client secret
checkout.config.description=Konfigurieren Sie die PayPal API-Berechtigung f\u00FCr den PayPal Zugang mit den Elementen Client ID und Client Secret. Diese zwei Sicherheitselemente m\u00FCssen Sie zuerst in Ihrem PayPal Businesskonto erstellen. OpenOlat unterst\u00FCtzt nicht nachtr\u00E4gliche Anderungen am Bestellungen von Ihrem Paypal Konto. checkout.config.description=Konfigurieren Sie die PayPal API-Berechtigung f\u00FCr den PayPal Zugang mit den Elementen Client ID und Client Secret. Diese zwei Sicherheitselemente m\u00FCssen Sie zuerst in Ihrem PayPal Businesskonto erstellen. <strong>OpenOlat unterst\u00FCtzt nicht nachtr\u00E4gliche Anderungen am Bestellungen von Ihrem Paypal Konto.</strong>
checkout.config.title=Paypal Checkout konfigurieren checkout.config.title=Paypal Checkout konfigurieren
config.disabled.warning=Warning config.disabled.warning=Warning
currency=W\u00E4hrung currency=W\u00E4hrung
......
...@@ -4,7 +4,7 @@ access.paypal.desc=PayPal description ...@@ -4,7 +4,7 @@ access.paypal.desc=PayPal description
access.paypal.title=Pay with PayPal access.paypal.title=Pay with PayPal
checkout.client.id=Client ID checkout.client.id=Client ID
checkout.client.secret=Client secret checkout.client.secret=Client secret
checkout.config.description=Configure your authorisation to use your Paypal count with the Client ID and Client Secret. These two security elements must be created in your Paypal Business Account. OpenOlat doesn't support subsequent changes in order from your Paypal Account (yet). checkout.config.description=Configure your authorisation to use your Paypal count with the Client ID and Client Secret. These two security elements must be created in your Paypal Business Account. <strong>OpenOlat doesn't support subsequent changes in order from your Paypal Account (yet).</strong>
checkout.config.title=Configure Paypal Checkout checkout.config.title=Configure Paypal Checkout
config.disabled.warning=config.disabled.warning config.disabled.warning=config.disabled.warning
currency=Currency currency=Currency
......
#Wed Jan 11 18:32:30 CET 2017 #Mon Aug 26 20:05:20 CEST 2019
access.button=Payer
access.paypal.desc=Cet objet didactique peut \u00EAtre achet\u00E9 avec un compte Paypal. Cliquez sur le bouton "Payer" pour enregistrer votre acc\u00E8s.
access.paypal.title=Payer avec Paypal
checkout.client.id=Client ID
checkout.client.secret=Client secret
checkout.config.title=Configurer Paypal Checkout
currency=Monnaie
currency.error=Erreur, monnaie incorrecte
delivery=Acheteur
filter.canceled=Annul\u00E9
filter.completed=Compl\u00E9t\u00E9 avec succ\u00E8s
filter.created=Nouvelle commande Paypal
filter.error=Erreur
filter.new=Nouvelle commande (OpenOlat)
offer.description=$org.olat.resource.accesscontrol.ui\:offer.description
offer.price=Prix
oo.order.nr=ID commande (OpenOlat)
paypal.before.redirect.error=Erreur inattendue
paypal.capture.id=Capture ID
paypal.checkout.method=Paypal Checkout v2
paypal.config.description=Configurez l'autorisation d'acc\u00E8s \u00E0 l'API PayPal\: Client ID et Client Secret. Ce sont les deux \u00E9l\u00E9ments de s\u00E9curit\u00E9 dont vous avez besoin pour cr\u00E9er votre compte PayPal Business. paypal.config.description=Configurez l'autorisation d'acc\u00E8s \u00E0 l'API PayPal\: Client ID et Client Secret. Ce sont les deux \u00E9l\u00E9ments de s\u00E9curit\u00E9 dont vous avez besoin pour cr\u00E9er votre compte PayPal Business.
paypal.invoice.id=Facture ID
paypal.menu.title=Paypal
paypal.menu.title.alt=Configurer Paypal Checkout
paypal.order.id=ID commande (Paypal)
paypal.order.status=Statut
paypal.order.status.reason=Raison du statut
paypal.segment.account=Compte
paypal.segment.transactions=Transactions
paypal.transaction.amount=Prix (Paypal)
paypal.transaction.title=Transaction Paypal "{0}"
paypal.transactions.empty=Pas de transactions trouv\u00E9es
price=Prix
show.all=Tout afficher
status.canceled=Annul\u00E9
status.error=Erreur inattendue
status.new=Nouveau (pas compl\u00E9t\u00E9)
status.success=Compl\u00E9t\u00E9 avec succ\u00E8s
status.unkown=Inconnu\: {0}
table.header.order.date=Date
table.header.order.id=ID commande Paypal
table.header.order.nr=Id commande OpenOlat
table.header.order.oo.status=Statut OpenOlat
table.header.order.status=Statut
vat.enabled=TVA
vat.on=inclus
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment