public PaymentApiException(final AccountApiException e) { super(e, e.getCode(), e.getMessage()); }
@Subscribe public void handleBlockingStateTransition(final BlockingTransitionInternalEvent event) { // We are only interested in blockBilling or unblockBilling transitions. if (!event.isTransitionedToUnblockedBilling() && !event.isTransitionedToBlockedBilling()) { return; } try { final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "SubscriptionBaseTransition", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken()); final UUID accountId = accountApi.getByRecordId(event.getSearchKey1(), context); dispatcher.processAccount(accountId, clock.getUTCNow(), false, context); } catch (InvoiceApiException e) { log.error(e.getMessage()); } catch (AccountApiException e) { log.error(e.getMessage()); } }
@Override public void handleKillbillEvent(final ExtBusEvent killbillEvent) { logService.log(LogService.LOG_INFO, "Received external event " + killbillEvent.toString()); // Only looking at account creation if (killbillEvent.getEventType() != ExtBusEventType.ACCOUNT_CREATION) { return; } final TenantContext tenantContext = new TenantContext() { @Override public UUID getTenantId() { return null; } }; try { Account account = killbillAPI.getAccountUserApi().getAccountById(killbillEvent.getAccountId(), tenantContext); testDao.insertAccountExternalKey(account.getExternalKey()); } catch (AccountApiException e) { logService.log(LogService.LOG_ERROR, e.getMessage()); } } }
@Override public void handleKillbillEvent(final ExtBusEvent killbillEvent) { logService.log(LogService.LOG_INFO, "Received external event " + killbillEvent.toString()); // Only looking at account creation if (killbillEvent.getEventType() != ExtBusEventType.ACCOUNT_CREATION) { return; } final TenantContext tenantContext = new TenantContext() { @Override public UUID getTenantId() { return null; } }; try { Account account = killbillAPI.getAccountUserApi().getAccountById(killbillEvent.getAccountId(), tenantContext); testDao.insertAccountExternalKey(account.getExternalKey()); } catch (AccountApiException e) { logService.log(LogService.LOG_ERROR, e.getMessage()); } } }