protected PaymentMethod getPaymentMethod(final UUID paymentMethodId, final TenantContext context) throws OSGIServiceNotAvailable { final PaymentApi paymentApi = getPaymentUserApi(); try { return paymentApi.getPaymentMethodById(paymentMethodId, true, false, PLUGIN_PROPERTIES, context); } catch (final PaymentApiException e) { logService.log(LogService.LOG_INFO, "Error retrieving payment method for paymentMethodId " + paymentMethodId + ": " + e.getMessage()); throw new OSGIServiceNotAvailable(e); } }
protected List<PaymentMethod> getPaymentMethodsForAccount(final UUID accountId, final TenantContext context) throws OSGIServiceNotAvailable { final PaymentApi paymentApi = getPaymentUserApi(); try { // Try to get all payment methods, with plugin information // TODO this will not return deleted payment methods return paymentApi.getAccountPaymentMethods(accountId, false, true, PLUGIN_PROPERTIES, context); } catch (final PaymentApiException e) { logService.log(LogService.LOG_INFO, "Error retrieving payment methods for accountId " + accountId + ": " + e.getMessage()); throw new OSGIServiceNotAvailable(e); } }
protected PaymentTransaction getPaymentTransaction(final UUID kbPaymentId, final UUID kbTransactionId, final TenantContext context) throws OSGIServiceNotAvailable { final Payment payment; try { payment = getPaymentUserApi().getPayment(kbPaymentId, false, false, PLUGIN_PROPERTIES, context); } catch (final PaymentApiException e) { logService.log(LogService.LOG_INFO, "Error retrieving payment for paymentId " + kbPaymentId + ": " + e.getMessage()); throw new OSGIServiceNotAvailable(e); } return getPaymentTransaction(kbTransactionId, payment); }
fail("Failed to create payment", e); } else { log.info(e.getMessage());