Codota Logo
PlanPhase.getBillingPeriod
Code IndexAdd Codota to your IDE (free)

How to use
getBillingPeriod
method
in
com.ning.billing.catalog.api.PlanPhase

Best Java code snippets using com.ning.billing.catalog.api.PlanPhase.getBillingPeriod (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: com.ning.billing/killbill-analytics

if (thePhase.getBillingPeriod() != null) {
  billingPeriod = thePhase.getBillingPeriod().toString();
} else {
  billingPeriod = null;
  mrr = getMrrFromBillingPeriod(thePhase.getBillingPeriod(), price);
} else {
  price = BigDecimal.ZERO;
origin: com.ning.billing/killbill-analytics

if (currentPhase.getBillingPeriod() != null) {
  billingPeriod = currentPhase.getBillingPeriod().toString();
} else {
  billingPeriod = null;
  mrr = getMrrFromBillingPeriod(currentPhase.getBillingPeriod(), price);
} else {
  price = BigDecimal.ZERO;
origin: com.ning.billing/killbill-analytics

@Test(groups = "fast")
public void testConstructor() throws Exception {
  Assert.assertEquals(subscription.getRoundedMrr(), 0.0);
  Assert.assertEquals(subscription.getSlug(), phase.getName());
  Assert.assertEquals(subscription.getPhase(), phase.getPhaseType().toString());
  Assert.assertEquals(subscription.getBillingPeriod(), phase.getBillingPeriod());
  Assert.assertEquals(subscription.getPrice(), phase.getRecurringPrice().getPrice(null));
  Assert.assertEquals(subscription.getProductCategory(), product.getCategory());
  Assert.assertEquals(subscription.getProductName(), product.getName());
  Assert.assertEquals(subscription.getProductType(), product.getCatalogName());
  Assert.assertEquals(subscription.getStartDate(), isubscription.getStartDate());
}
origin: com.ning.billing/killbill-junction

private void checkEvent(final BillingEvent event, final Plan nextPlan, final int BCD, final UUID id, final DateTime time,
            final PlanPhase nextPhase, final String desc, final InternationalPrice fixedPrice, final InternationalPrice recurringPrice) throws CatalogApiException {
  if (fixedPrice != null) {
    Assert.assertEquals(fixedPrice.getPrice(Currency.USD), event.getFixedPrice());
  } else {
    assertNull(event.getFixedPrice());
  }
  if (recurringPrice != null) {
    Assert.assertEquals(recurringPrice.getPrice(Currency.USD), event.getRecurringPrice());
  } else {
    assertNull(event.getRecurringPrice());
  }
  Assert.assertEquals(BCD, event.getBillCycleDayLocal());
  Assert.assertEquals(id, event.getSubscription().getId());
  Assert.assertEquals(time.getDayOfMonth(), event.getEffectiveDate().getDayOfMonth());
  Assert.assertEquals(nextPhase, event.getPlanPhase());
  Assert.assertEquals(nextPlan, event.getPlan());
  if (!SubscriptionBaseTransitionType.START_BILLING_DISABLED.equals(event.getTransitionType())) {
    Assert.assertEquals(nextPhase.getBillingPeriod(), event.getBillingPeriod());
  }
  Assert.assertEquals(BillingModeType.IN_ADVANCE, event.getBillingMode());
  Assert.assertEquals(desc, event.getTransitionType().toString());
}
origin: com.ning.billing/killbill-analytics

public BusinessInvoiceItemModelDao(@Nullable final String externalKey, final InvoiceItem invoiceItem, @Nullable final Plan plan, @Nullable final PlanPhase planPhase) {
  this(invoiceItem.getAmount(), planPhase != null ? planPhase.getBillingPeriod().toString() : null, invoiceItem.getCreatedDate(), invoiceItem.getCurrency(),
     /* Populate end date for fixed items for convenience (null in invoice_items table) */
     (invoiceItem.getEndDate() == null && planPhase != null) ? invoiceItem.getStartDate().plus(planPhase.getDuration().toJodaPeriod()) : invoiceItem.getEndDate(),
     externalKey, invoiceItem.getInvoiceId(), invoiceItem.getId(), invoiceItem.getLinkedItemId(), invoiceItem.getInvoiceItemType().toString(),
     planPhase != null ? planPhase.getPhaseType().toString() : null, plan != null ? plan.getProduct().getCategory().toString() : null,
     plan != null ? plan.getProduct().getName() : null, plan != null ? plan.getProduct().getCatalogName() : null,
     planPhase != null ? planPhase.getName() : null, invoiceItem.getStartDate(), invoiceItem.getUpdatedDate());
}
origin: com.ning.billing/killbill-invoice

private BillingEvent createBillingEvent(final UUID subscriptionId, final UUID bundleId, final LocalDate startDate,
                    final Plan plan, final PlanPhase planPhase, final int billCycleDayLocal) throws CatalogApiException {
  final SubscriptionBase sub = createSubscription(subscriptionId, bundleId);
  final Currency currency = Currency.USD;
  return invoiceUtil.createMockBillingEvent(null, sub, startDate.toDateTimeAtStartOfDay(), plan, planPhase,
                       planPhase.getFixedPrice() == null ? null : planPhase.getFixedPrice().getPrice(currency),
                       planPhase.getRecurringPrice() == null ? null : planPhase.getRecurringPrice().getPrice(currency),
                       currency, planPhase.getBillingPeriod(),
                       billCycleDayLocal, BillingModeType.IN_ADVANCE, "Test", 1L, SubscriptionBaseTransitionType.CREATE);
}
origin: com.ning.billing/killbill-junction

public DefaultBillingEvent(final Account account, final EffectiveSubscriptionInternalEvent transition, final SubscriptionBase subscription, final int billCycleDayLocal, final Currency currency, final Catalog catalog) throws CatalogApiException {
  this.account = account;
  this.billCycleDayLocal = billCycleDayLocal;
  this.subscription = subscription;
  effectiveDate = transition.getEffectiveTransitionTime();
  final String planPhaseName = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ?
      transition.getNextPhase() : transition.getPreviousPhase();
  planPhase = (planPhaseName != null) ? catalog.findPhase(planPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final String planName = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ?
      transition.getNextPlan() : transition.getPreviousPlan();
  plan = (planName != null) ? catalog.findPlan(planName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final String nextPhaseName = transition.getNextPhase();
  final PlanPhase nextPhase = (nextPhaseName != null) ? catalog.findPhase(nextPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final String prevPhaseName = transition.getPreviousPhase();
  final PlanPhase prevPhase = (prevPhaseName != null) ? catalog.findPhase(prevPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  fixedPrice = (nextPhase != null && nextPhase.getFixedPrice() != null) ? nextPhase.getFixedPrice().getPrice(currency) : null;
  recurringPrice = (nextPhase != null && nextPhase.getRecurringPrice() != null) ? nextPhase.getRecurringPrice().getPrice(currency) : null;
  this.currency = currency;
  description = transition.getTransitionType().toString();
  billingModeType = BillingModeType.IN_ADVANCE;
  billingPeriod = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ?
      nextPhase.getBillingPeriod() : prevPhase.getBillingPeriod();
  type = transition.getTransitionType();
  totalOrdering = transition.getTotalOrdering();
  timeZone = account.getTimeZone();
}
origin: com.ning.billing/killbill-junction

protected int calculateBcd(final SubscriptionBaseBundle bundle, final SubscriptionBase subscription, final EffectiveSubscriptionInternalEvent transition, final Account account, final InternalCallContext context)
    throws CatalogApiException, AccountApiException, SubscriptionBaseApiException {
  final Catalog catalog = catalogService.getFullCatalog();
  final Plan prevPlan = (transition.getPreviousPlan() != null) ? catalog.findPlan(transition.getPreviousPlan(), transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final Plan nextPlan = (transition.getNextPlan() != null) ? catalog.findPlan(transition.getNextPlan(), transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final Plan plan = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ? nextPlan : prevPlan;
  final Product product = plan.getProduct();
  final PlanPhase prevPhase = (transition.getPreviousPhase() != null) ? catalog.findPhase(transition.getPreviousPhase(), transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final PlanPhase nextPhase = (transition.getNextPhase() != null) ? catalog.findPhase(transition.getNextPhase(), transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
  final PlanPhase phase = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ? nextPhase : prevPhase;
  final BillingAlignment alignment = catalog.billingAlignment(
      new PlanPhaseSpecifier(product.getName(),
                  product.getCategory(),
                  phase.getBillingPeriod(),
                  transition.getNextPriceList(),
                  phase.getPhaseType()),
      transition.getRequestedTransitionTime());
  return calculateBcdForAlignment(alignment, bundle, subscription, account, catalog, plan, context);
}
com.ning.billing.catalog.apiPlanPhasegetBillingPeriod

Popular methods of PlanPhase

  • getName
  • getRecurringPrice
  • getPhaseType
  • getDuration
  • getFixedPrice
  • compliesWithLimits

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now