congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PlanSpecifier.getPriceListName
Code IndexAdd Tabnine to your IDE (free)

How to use
getPriceListName
method
in
org.killbill.billing.catalog.api.PlanSpecifier

Best Java code snippets using org.killbill.billing.catalog.api.PlanSpecifier.getPriceListName (Showing top 17 results out of 315)

origin: killbill/killbill

private DefaultPriceList findPriceList(final PlanSpecifier specifier, final StaticCatalog catalog) throws CatalogApiException {
  DefaultPriceList result = DefaultCasePriceList.getResult(priceListCase, specifier, catalog);
  if (result == null) {
    final String priceListName = specifier.getPlanName() != null ? catalog.findCurrentPlan(specifier.getPlanName()).getPriceListName() : specifier.getPriceListName();
    result = (DefaultPriceList) catalog.findCurrentPricelist(priceListName);
  }
  return result;
}
origin: killbill/killbill

public PlanChangeResult planChange(final PlanPhaseSpecifier from, final PlanSpecifier to, final StaticCatalog catalog) throws CatalogApiException {
  final DefaultPriceList toPriceList = to.getPriceListName() != null ?
                     (DefaultPriceList) catalog.findCurrentPricelist(to.getPriceListName()) :
                     findPriceList(from, catalog);
  // If we use old scheme {product, billingPeriod, pricelist}, ensure pricelist is correct
  // (Pricelist may be null because if it is unspecified this is the principal use-case)
  final PlanSpecifier toWithPriceList = to.getPlanName() == null ?
                     new PlanSpecifier(to.getProductName(), to.getBillingPeriod(), toPriceList.getName()) :
                     to;
  final BillingActionPolicy policy = getPlanChangePolicy(from, toWithPriceList, catalog);
  if (policy == BillingActionPolicy.ILLEGAL) {
    throw new IllegalPlanChange(from, toWithPriceList);
  }
  final PlanAlignmentChange alignment = getPlanChangeAlignment(from, toWithPriceList, catalog);
  return new PlanChangeResult(toPriceList, policy, alignment);
}
origin: killbill/killbill

@Override
public Plan createOrFindCurrentPlan(final PlanSpecifier spec, final PlanPhasePriceOverridesWithCallContext unused) throws CatalogApiException {
  final Plan result;
  if (spec.getPlanName() != null) {
    result = findCurrentPlan(spec.getPlanName());
  } else {
    if (spec.getProductName() == null) {
      throw new CatalogApiException(ErrorCode.CAT_NULL_PRODUCT_NAME);
    }
    if (spec.getBillingPeriod() == null) {
      throw new CatalogApiException(ErrorCode.CAT_NULL_BILLING_PERIOD);
    }
    final String inputOrDefaultPricelist = (spec.getPriceListName() == null) ? PriceListSet.DEFAULT_PRICELIST_NAME : spec.getPriceListName();
    final Product product = findCurrentProduct(spec.getProductName());
    result = priceLists.getPlanFrom(product, spec.getBillingPeriod(), inputOrDefaultPricelist);
  }
  if (result == null) {
    throw new CatalogApiException(ErrorCode.CAT_PLAN_NOT_FOUND,
                   spec.getPlanName() != null ? spec.getPlanName() : "undefined",
                   spec.getProductName() != null ? spec.getProductName() : "undefined",
                   spec.getBillingPeriod() != null ? spec.getBillingPeriod() : "undefined",
                   spec.getPriceListName() != null ? spec.getPriceListName() : "undefined");
  }
  return result;
}
origin: killbill/killbill

spec.getProductName() != null ? spec.getProductName() : "undefined",
spec.getBillingPeriod() != null ? spec.getBillingPeriod() : "undefined",
spec.getPriceListName() != null ? spec.getPriceListName() : "undefined");
origin: killbill/killbill

inToBillingPeriod = to.getBillingPeriod();
inToProductCategory = inToProduct.getCategory();
inToPriceList = to.getPriceListName() != null ? catalog.findCurrentPricelist(to.getPriceListName()) : null;
origin: killbill/killbill

protected boolean satisfiesCase(final PlanSpecifier planPhase, final StaticCatalog c) throws CatalogApiException {
  final Product product;
  final BillingPeriod billingPeriod;
  final ProductCategory productCategory;
  final PriceList priceList;
  if (planPhase.getPlanName() != null) {
    final Plan plan = c.findCurrentPlan(planPhase.getPlanName());
    product = plan.getProduct();
    billingPeriod = plan.getRecurringBillingPeriod();
    productCategory = plan.getProduct().getCategory();
    priceList = c.findCurrentPricelist(plan.getPriceListName());
  } else {
    product = c.findCurrentProduct(planPhase.getProductName());
    billingPeriod = planPhase.getBillingPeriod();
    productCategory = product.getCategory();
    priceList = getPriceList() != null ? c.findCurrentPricelist(planPhase.getPriceListName()) : null;
  }
  return (getProduct() == null || getProduct().equals(product)) &&
      (getProductCategory() == null || getProductCategory().equals(productCategory)) &&
      (getBillingPeriod() == null || getBillingPeriod().equals(billingPeriod)) &&
      (getPriceList() == null || getPriceList().equals(priceList));
}
origin: org.kill-bill.billing/killbill-api

public IllegalPlanChange(final PlanPhaseSpecifier from,
             final PlanSpecifier to) {
  super(ErrorCode.CAT_ILLEGAL_CHANGE_REQUEST, from.getProductName(), from.getBillingPeriod(), from.getPriceListName(), to.getProductName(), to.getBillingPeriod(), to.getPriceListName());
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public IllegalPlanChange(final Throwable cause, final PlanPhaseSpecifier from,
             final PlanSpecifier to) {
  super(cause, ErrorCode.CAT_ILLEGAL_CHANGE_REQUEST, from.getProductName(), from.getBillingPeriod(), from.getPriceListName(), to.getProductName(), to.getBillingPeriod(), to.getPriceListName());
}
origin: org.kill-bill.billing/killbill-api

public IllegalPlanChange(final Throwable cause, final PlanPhaseSpecifier from,
             final PlanSpecifier to) {
  super(cause, ErrorCode.CAT_ILLEGAL_CHANGE_REQUEST, from.getProductName(), from.getBillingPeriod(), from.getPriceListName(), to.getProductName(), to.getBillingPeriod(), to.getPriceListName());
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public IllegalPlanChange(final PlanPhaseSpecifier from,
             final PlanSpecifier to) {
  super(ErrorCode.CAT_ILLEGAL_CHANGE_REQUEST, from.getProductName(), from.getBillingPeriod(), from.getPriceListName(), to.getProductName(), to.getBillingPeriod(), to.getPriceListName());
}
origin: org.kill-bill.billing/killbill-catalog

private DefaultPriceList findPriceList(final PlanSpecifier specifier, final StaticCatalog catalog) throws CatalogApiException {
  DefaultPriceList result = DefaultCasePriceList.getResult(priceListCase, specifier, catalog);
  if (result == null) {
    final String priceListName = specifier.getPlanName() != null ? catalog.findCurrentPlan(specifier.getPlanName()).getPriceListName() : specifier.getPriceListName();
    result = (DefaultPriceList) catalog.findCurrentPricelist(priceListName);
  }
  return result;
}
origin: org.kill-bill.billing/killbill-catalog

@Override
public Plan createOrFindCurrentPlan(final PlanSpecifier spec, final PlanPhasePriceOverridesWithCallContext unused) throws CatalogApiException {
  final Plan result;
  if (spec.getPlanName() != null) {
    result = findCurrentPlan(spec.getPlanName());
  } else {
    if (spec.getProductName() == null) {
      throw new CatalogApiException(ErrorCode.CAT_NULL_PRODUCT_NAME);
    }
    if (spec.getBillingPeriod() == null) {
      throw new CatalogApiException(ErrorCode.CAT_NULL_BILLING_PERIOD);
    }
    final String inputOrDefaultPricelist = (spec.getPriceListName() == null) ? PriceListSet.DEFAULT_PRICELIST_NAME : spec.getPriceListName();
    final Product product = findCurrentProduct(spec.getProductName());
    result = priceLists.getPlanFrom(product, spec.getBillingPeriod(), inputOrDefaultPricelist);
  }
  if (result == null) {
    throw new CatalogApiException(ErrorCode.CAT_PLAN_NOT_FOUND,
                   spec.getPlanName() != null ? spec.getPlanName() : "undefined",
                   spec.getProductName() != null ? spec.getProductName() : "undefined",
                   spec.getBillingPeriod() != null ? spec.getBillingPeriod() : "undefined",
                   spec.getPriceListName() != null ? spec.getPriceListName() : "undefined");
  }
  return result;
}
origin: org.kill-bill.billing/killbill-catalog

public PlanChangeResult planChange(final PlanPhaseSpecifier from, final PlanSpecifier to, final StaticCatalog catalog) throws CatalogApiException {
  final DefaultPriceList toPriceList = to.getPriceListName() != null ?
                     (DefaultPriceList) catalog.findCurrentPricelist(to.getPriceListName()) :
                     findPriceList(from, catalog);
  // If we use old scheme {product, billingPeriod, pricelist}, ensure pricelist is correct
  // (Pricelist may be null because if it is unspecified this is the principal use-case)
  final PlanSpecifier toWithPriceList = to.getPlanName() == null ?
                     new PlanSpecifier(to.getProductName(), to.getBillingPeriod(), toPriceList.getName()) :
                     to;
  final BillingActionPolicy policy = getPlanChangePolicy(from, toWithPriceList, catalog);
  if (policy == BillingActionPolicy.ILLEGAL) {
    throw new IllegalPlanChange(from, toWithPriceList);
  }
  final PlanAlignmentChange alignment = getPlanChangeAlignment(from, toWithPriceList, catalog);
  return new PlanChangeResult(toPriceList, policy, alignment);
}
origin: org.kill-bill.billing/killbill-catalog

spec.getProductName() != null ? spec.getProductName() : "undefined",
spec.getBillingPeriod() != null ? spec.getBillingPeriod() : "undefined",
spec.getPriceListName() != null ? spec.getPriceListName() : "undefined");
origin: org.kill-bill.billing/killbill-jaxrs

                       new PlanPhaseSpecifier(spec.getProductName(), spec.getBillingPeriod(), spec.getPriceListName(), phaseType);
final Currency resolvedCurrency = input.getFixedPrice() != null || input.getRecurringPrice() != null ? currency : null;
origin: org.kill-bill.billing/killbill-catalog

inToBillingPeriod = to.getBillingPeriod();
inToProductCategory = inToProduct.getCategory();
inToPriceList = to.getPriceListName() != null ? catalog.findCurrentPricelist(to.getPriceListName()) : null;
origin: org.kill-bill.billing/killbill-catalog

protected boolean satisfiesCase(final PlanSpecifier planPhase, final StaticCatalog c) throws CatalogApiException {
  final Product product;
  final BillingPeriod billingPeriod;
  final ProductCategory productCategory;
  final PriceList priceList;
  if (planPhase.getPlanName() != null) {
    final Plan plan = c.findCurrentPlan(planPhase.getPlanName());
    product = plan.getProduct();
    billingPeriod = plan.getRecurringBillingPeriod();
    productCategory = plan.getProduct().getCategory();
    priceList = c.findCurrentPricelist(plan.getPriceListName());
  } else {
    product = c.findCurrentProduct(planPhase.getProductName());
    billingPeriod = planPhase.getBillingPeriod();
    productCategory = product.getCategory();
    priceList = getPriceList() != null ? c.findCurrentPricelist(planPhase.getPriceListName()) : null;
  }
  return (getProduct() == null || getProduct().equals(product)) &&
      (getProductCategory() == null || getProductCategory().equals(productCategory)) &&
      (getBillingPeriod() == null || getBillingPeriod().equals(billingPeriod)) &&
      (getPriceList() == null || getPriceList().equals(priceList));
}
org.killbill.billing.catalog.apiPlanSpecifiergetPriceListName

Popular methods of PlanSpecifier

  • <init>
  • getBillingPeriod
  • getProductName
  • getPlanName

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Runner (org.openjdk.jmh.runner)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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