Search in sources :

Example 1 with DefaultSubscriptionBillingEvent

use of org.killbill.billing.subscription.api.user.DefaultSubscriptionBillingEvent in project killbill by killbill.

the class TestBillingApi method createSubscriptionCreationEvent.

private DateTime createSubscriptionCreationEvent(final Plan nextPlan, final PlanPhase nextPhase) throws CatalogApiException {
    final DateTime now = clock.getUTCNow();
    final DateTime then = now.minusDays(1);
    final EffectiveSubscriptionInternalEvent t = new MockEffectiveSubscriptionEvent(eventId, subId, bunId, bunKey, then, now, null, null, null, null, null, EntitlementState.ACTIVE, nextPlan.getName(), nextPhase.getName(), nextPlan.getPriceList().getName(), null, 1L, SubscriptionBaseTransitionType.CREATE, 1, null, 1L, 2L, null);
    effectiveSubscriptionTransitions.add(t);
    billingTransitions.add(new DefaultSubscriptionBillingEvent(SubscriptionBaseTransitionType.CREATE, nextPlan, nextPhase, now, 1L, null, CatalogDateHelper.toUTCDateTime(nextPlan.getCatalog().getEffectiveDate())));
    return now;
}
Also used : DefaultSubscriptionBillingEvent(org.killbill.billing.subscription.api.user.DefaultSubscriptionBillingEvent) EffectiveSubscriptionInternalEvent(org.killbill.billing.events.EffectiveSubscriptionInternalEvent) MockEffectiveSubscriptionEvent(org.killbill.billing.mock.MockEffectiveSubscriptionEvent) DateTime(org.joda.time.DateTime)

Aggregations

DateTime (org.joda.time.DateTime)1 EffectiveSubscriptionInternalEvent (org.killbill.billing.events.EffectiveSubscriptionInternalEvent)1 MockEffectiveSubscriptionEvent (org.killbill.billing.mock.MockEffectiveSubscriptionEvent)1 DefaultSubscriptionBillingEvent (org.killbill.billing.subscription.api.user.DefaultSubscriptionBillingEvent)1