Search in sources :

Example 6 with PaypalAccessMethod

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;
}
Also used : PaypalAccessMethod(org.olat.resource.accesscontrol.provider.paypal.model.PaypalAccessMethod) Date(java.util.Date)

Aggregations

PaypalAccessMethod (org.olat.resource.accesscontrol.provider.paypal.model.PaypalAccessMethod)6 Identity (org.olat.core.id.Identity)4 AccessTransaction (org.olat.resource.accesscontrol.AccessTransaction)4 Order (org.olat.resource.accesscontrol.Order)4 OrderLine (org.olat.resource.accesscontrol.OrderLine)4 OrderPart (org.olat.resource.accesscontrol.OrderPart)4 Date (java.util.Date)2 ResourceReservation (org.olat.resource.accesscontrol.ResourceReservation)2