@Override public Collection<PaymentOption> getAllPaymentOptions( final Currency currency, final Platform platform) { notNull(platform, "platform may not be null"); notNull(currency, "currency may not be null"); return paymentOptionDao.findByCurrencyAndPlatform(currency, platform); }
@Override public PaymentOption getDefault(final String paymentOptionId, final Platform platform) { notNull(paymentOptionId, "paymentOptionId may not be null"); notNull(platform, "platform may not be null"); final Optional<PaymentOption> paymentOption = paymentOptionDao.findByIdAndPlatform(paymentOptionId, platform); if (paymentOption.isPresent()) { return paymentOption.get(); } return null; }
@Override public Map<Currency, List<PaymentOption>> getAllDefaults(final Platform platform) { notNull(platform, "platform may not be null"); final Map<Currency, List<PaymentOption>> options = new HashMap<Currency, List<PaymentOption>>(); for (Currency key : Currency.values()) { final List<PaymentOption> paymentOptions = paymentOptionDao.findByCurrencyAndPlatform(key, platform); if (paymentOptions != null) { options.put(key, paymentOptions); } } return options; }
@Override public Collection<PaymentOption> getAllPaymentOptions(final Platform platform) { return paymentOptionDao.findByPlatform(platform); }