Search in sources :

Example 1 with PSPTransaction

use of org.olat.resource.accesscontrol.model.PSPTransaction in project openolat by klemens.

the class PaypalAccessHandler method getPSPTransactions.

@Override
public List<PSPTransaction> getPSPTransactions(List<Order> orders) {
    PaypalManager paypalManager = CoreSpringFactory.getImpl(PaypalManager.class);
    List<PSPTransaction> transactions = paypalManager.loadTransactions(orders);
    return transactions;
}
Also used : PaypalManager(org.olat.resource.accesscontrol.provider.paypal.manager.PaypalManager) PSPTransaction(org.olat.resource.accesscontrol.model.PSPTransaction)

Example 2 with PSPTransaction

use of org.olat.resource.accesscontrol.model.PSPTransaction in project openolat by klemens.

the class PaypalManagerImpl method loadTransactions.

@Override
public List<PSPTransaction> loadTransactions(List<Order> orders) {
    if (orders == null || orders.isEmpty())
        return Collections.emptyList();
    StringBuilder sb = new StringBuilder();
    sb.append("select trx from ").append(PaypalTransaction.class.getName()).append(" as trx where ");
    sb.append("trx.orderId in (:orderIds)");
    List<Long> orderIds = new ArrayList<Long>(orders.size());
    for (Order order : orders) {
        orderIds.add(order.getKey());
    }
    List<PSPTransaction> transactions = dbInstance.getCurrentEntityManager().createQuery(sb.toString(), PSPTransaction.class).setParameter("orderIds", orderIds).getResultList();
    return transactions;
}
Also used : Order(org.olat.resource.accesscontrol.Order) ArrayList(java.util.ArrayList) PSPTransaction(org.olat.resource.accesscontrol.model.PSPTransaction)

Example 3 with PSPTransaction

use of org.olat.resource.accesscontrol.model.PSPTransaction in project OpenOLAT by OpenOLAT.

the class PaypalAccessHandler method getPSPTransactions.

@Override
public List<PSPTransaction> getPSPTransactions(List<Order> orders) {
    PaypalManager paypalManager = CoreSpringFactory.getImpl(PaypalManager.class);
    List<PSPTransaction> transactions = paypalManager.loadTransactions(orders);
    return transactions;
}
Also used : PaypalManager(org.olat.resource.accesscontrol.provider.paypal.manager.PaypalManager) PSPTransaction(org.olat.resource.accesscontrol.model.PSPTransaction)

Example 4 with PSPTransaction

use of org.olat.resource.accesscontrol.model.PSPTransaction in project OpenOLAT by OpenOLAT.

the class PaypalManagerImpl method loadTransactions.

@Override
public List<PSPTransaction> loadTransactions(List<Order> orders) {
    if (orders == null || orders.isEmpty())
        return Collections.emptyList();
    StringBuilder sb = new StringBuilder();
    sb.append("select trx from ").append(PaypalTransaction.class.getName()).append(" as trx where ");
    sb.append("trx.orderId in (:orderIds)");
    List<Long> orderIds = new ArrayList<Long>(orders.size());
    for (Order order : orders) {
        orderIds.add(order.getKey());
    }
    List<PSPTransaction> transactions = dbInstance.getCurrentEntityManager().createQuery(sb.toString(), PSPTransaction.class).setParameter("orderIds", orderIds).getResultList();
    return transactions;
}
Also used : Order(org.olat.resource.accesscontrol.Order) ArrayList(java.util.ArrayList) PSPTransaction(org.olat.resource.accesscontrol.model.PSPTransaction)

Aggregations

PSPTransaction (org.olat.resource.accesscontrol.model.PSPTransaction)4 ArrayList (java.util.ArrayList)2 Order (org.olat.resource.accesscontrol.Order)2 PaypalManager (org.olat.resource.accesscontrol.provider.paypal.manager.PaypalManager)2