log.info(String.format("Got subscription event %s", eventEffective.toString())); Assert.assertNotNull(eventEffective.getBundleExternalKey()); switch (eventEffective.getTransitionType()) { case TRANSFER: assertEqualsNicely(NextEvent.TRANSFER); break; default: throw new RuntimeException("Unexpected event type " + eventEffective.getRequestedTransitionTime());
assertTrue(subscriptionInternalApi.getAllTransitions(newBaseSubscription, internalCallContext).get(1).getEffectiveTransitionTime().compareTo(evergreenPhaseDate) == 0);
@Override public void run(final EffectiveSubscriptionInternalEvent event) { try { // Skip future uncancel event // Skip events which are marked as not being the last one if (event.getTransitionType() == SubscriptionBaseTransitionType.UNCANCEL || event.getRemainingEventsForUserOperation() > 0) { return; } final InternalCallContext context = internalCallContextFactory.createInternalCallContext(event.getSearchKey2(), event.getSearchKey1(), "SubscriptionBaseTransition", CallOrigin.INTERNAL, UserType.SYSTEM, event.getUserToken()); dispatcher.processSubscriptionForInvoiceGeneration(event, context); } catch (final InvoiceApiException e) { log.warn("Unable to process event {}", event, e); } } });
@Override public void onSubscriptionBaseTransition(final EffectiveSubscriptionInternalEvent event) { log.info("Got event SubscriptionBaseTransition token='{}', type='{}', remaining='{}'", event.getUserToken(), event.getTransitionType(), event.getRemainingEventsForUserOperation()); }
(billingTransitions.get(0).getTransitionType() != SubscriptionBaseTransitionType.CREATE && billingTransitions.get(0).getTransitionType() != SubscriptionBaseTransitionType.TRANSFER)) { log.warn("Skipping billing events for subscription " + subscription.getId() + ": Does not start with a valid CREATE transition"); skipSubscriptionsSet.add(subscription.getId()); final BillingAlignment alignment = catalog.billingAlignment(getPlanPhaseSpecifierFromTransition(catalog, transition), transition.getEffectiveTransitionTime(), subscription.getStartDate()); overridenBCD = transition.getNextBillCycleDayLocal() != null ? transition.getNextBillCycleDayLocal() : overridenBCD; final int bcdLocal = overridenBCD != null ? overridenBCD :
public void processSubscriptionForInvoiceGeneration(final EffectiveSubscriptionInternalEvent transition, final InternalCallContext context) throws InvoiceApiException { final UUID subscriptionId = transition.getSubscriptionId(); final LocalDate targetDate = context.toLocalDate(transition.getEffectiveTransitionTime()); processSubscriptionForInvoiceGeneration(subscriptionId, targetDate, false, context); }
log.info(String.format("Got subscription event %s", eventEffective.toString())); Assert.assertNotNull(eventEffective.getBundleExternalKey()); switch (eventEffective.getTransitionType()) { case TRANSFER: assertEqualsNicely(NextEvent.TRANSFER); break; default: throw new RuntimeException("Unexpected event type " + eventEffective.getRequestedTransitionTime());
assertTrue(subscriptionInternalApi.getAllTransitions(newBaseSubscription, internalCallContext).get(1).getEffectiveTransitionTime().compareTo(evergreenPhaseDate) == 0);
assertTrue(subscriptionInternalApi.getAllTransitions(newBaseSubscription, internalCallContext).get(1).getEffectiveTransitionTime().compareTo(evergreenPhaseDate) == 0);
assertTrue(subscriptionInternalApi.getAllTransitions(newBaseSubscription, internalCallContext).get(1).getEffectiveTransitionTime().compareTo(evergreenPhaseDate) == 0);