Tabnine Logo
PlanPhase.getFixedPrice
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.ning.billing/killbill-junction

private void checkFirstEvent(final SortedSet<BillingEvent> events, final Plan nextPlan,
               final int BCD, final UUID id, final DateTime time, final PlanPhase nextPhase, final String desc) throws CatalogApiException {
  Assert.assertEquals(events.size(), 1);
  checkEvent(events.first(), nextPlan, BCD, id, time, nextPhase, desc, nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
}
origin: com.ning.billing/killbill-junction

@Test(groups = "fast")
public void testBillingEventsWithBlock() throws CatalogApiException, AccountApiException {
  final Plan nextPlan = catalog.findPlan("PickupTrialEvergreen10USD", clock.getUTCNow());
  final PlanPhase nextPhase = nextPlan.getAllPhases()[1];
  final DateTime now = createSubscriptionCreationEvent(nextPlan, nextPhase);
  final Account account = createAccount(32);
  blockingStateDao.setBlockingState(new DefaultBlockingState(bunId, BlockingStateType.SUBSCRIPTION_BUNDLE,  DISABLED_BUNDLE, "test", true, true, true, now.plusDays(1)), clock, internalCallContext);
  blockingStateDao.setBlockingState(new DefaultBlockingState(bunId, BlockingStateType.SUBSCRIPTION_BUNDLE, CLEAR_BUNDLE, "test", false, false, false, now.plusDays(2)), clock, internalCallContext);
  final SortedSet<BillingEvent> events = billingInternalApi.getBillingEventsForAccountAndUpdateAccountBCD(account.getId(), internalCallContext);
  Assert.assertEquals(events.size(), 3);
  final Iterator<BillingEvent> it = events.iterator();
  checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now, nextPhase, SubscriptionBaseTransitionType.CREATE.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
  checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(1), nextPhase, SubscriptionBaseTransitionType.START_BILLING_DISABLED.toString(), null, null);
  checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(2), nextPhase, SubscriptionBaseTransitionType.END_BILLING_DISABLED.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
}
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();
}
com.ning.billing.catalog.apiPlanPhasegetFixedPrice

Popular methods of PlanPhase

  • getName
  • getRecurringPrice
  • getPhaseType
  • getBillingPeriod
  • getDuration
  • compliesWithLimits

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JFrame (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now