use of org.olat.resource.accesscontrol.provider.paypal.model.PaypalAccessMethod in project openolat by klemens.
the class PaypalManagerImpl method getMethodSecure.
private PaypalAccessMethod getMethodSecure(Long key) {
PaypalAccessMethod smethod = null;
List<PaypalAccessMethod> methods = getPaypalMethods();
if (methods.size() > 0) {
smethod = methods.get(0);
} else {
smethod = new PaypalAccessMethod();
smethod.setCreationDate(new Date());
smethod.setLastModified(smethod.getCreationDate());
save(smethod);
}
for (PaypalAccessMethod method : methods) {
if (key != null && key.equals(method.getKey())) {
smethod = method;
}
}
return smethod;
}
Aggregations