Ejemplo n.º 1
0
 @Override
 public PaymentMethodModelDao getPaymentMethodByExternalKey(
     final String paymentMethodExternalKey, final InternalTenantContext context) {
   synchronized (this) {
     for (final PaymentMethodModelDao cur : paymentMethods) {
       if (cur.getExternalKey().equals(paymentMethodExternalKey)) {
         return cur;
       }
     }
     return null;
   }
 }
Ejemplo n.º 2
0
 @Override
 public PaymentMethodModelDao getPaymentMethod(
     final UUID paymentMethodId, final InternalTenantContext context) {
   synchronized (this) {
     for (final PaymentMethodModelDao cur : paymentMethods) {
       if (cur.getId().equals(paymentMethodId)) {
         return cur;
       }
     }
     return null;
   }
 }
Ejemplo n.º 3
0
 @Override
 public void deletedPaymentMethod(final UUID paymentMethodId, final InternalCallContext context) {
   synchronized (this) {
     final Iterator<PaymentMethodModelDao> it = paymentMethods.iterator();
     while (it.hasNext()) {
       final PaymentMethodModelDao cur = it.next();
       if (cur.getId().equals(paymentMethodId)) {
         it.remove();
         break;
       }
     }
   }
 }
Ejemplo n.º 4
0
 @Override
 public List<PaymentMethodModelDao> getPaymentMethods(
     final UUID accountId, final InternalTenantContext context) {
   synchronized (this) {
     final List<PaymentMethodModelDao> result = new ArrayList<PaymentMethodModelDao>();
     for (final PaymentMethodModelDao cur : paymentMethods) {
       if (cur.getAccountId().equals(accountId)) {
         result.add(cur);
       }
     }
     return result;
   }
 }