@Override public Plan findPlan(final String productName, final BillingPeriod term, final String priceListName, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { return findPlan(new PlanRequestWrapper(productName, term, priceListName), requestedDate, subscriptionStartDate); }
@Override public Plan findPlan(final String productName, final BillingPeriod term, final String priceListName, final DateTime requestedDate) throws CatalogApiException { return versionForDate(requestedDate).findCurrentPlan(productName, term, priceListName); }
@Override public PriceList findPriceList(final String name, final DateTime requestedDate) throws CatalogApiException { return versionForDate(requestedDate).findCurrentPriceList(name); }
public MockPlanPhase(final MockPlan mockPlan) { setBillingPeriod(BillingPeriod.MONTHLY); setPhaseType(PhaseType.EVERGREEN); setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED)); setRecurringPrice(new MockInternationalPrice()); setFixedPrice(null); setPlan(mockPlan); }
public static MockPlan createJetTrialEvergreen1000USD() { return new MockPlan("JetTrialEvergreen1000USD", MockProduct.createJet(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public MockPlan(final String planName) { setName(planName); setProduct(new MockProduct()); setFinalPhase(new MockPlanPhase(this)); setInitialPhases(null); setPlansAllowedInBundle(1); }
public static MockPlanPhase create1USDMonthlyEvergreen() { return (MockPlanPhase) new MockPlanPhase(BillingPeriod.MONTHLY, PhaseType.EVERGREEN, new DefaultDuration().setUnit(TimeUnit.UNLIMITED), MockInternationalPrice.create1USD(), null).setPlan(MockPlan.createBicycleNoTrialEvergreen1USD()); }
public static MockPlanPhase createUSDMonthlyEvergreen(final String reccuringUSDPrice, final String fixedPrice) { return new MockPlanPhase(BillingPeriod.MONTHLY, PhaseType.EVERGREEN, new DefaultDuration().setUnit(TimeUnit.UNLIMITED), (reccuringUSDPrice == null) ? null : MockInternationalPrice.createUSD(reccuringUSDPrice), (fixedPrice == null) ? null : MockInternationalPrice.createUSD(fixedPrice)); }
public void populatePriceLists() { final DefaultPlan[] plans = getCurrentPlans(); final DefaultPriceList[] priceList = new DefaultPriceList[plans.length - 1]; for (int i = 1; i < plans.length; i++) { priceList[i - 1] = new DefaultPriceList(new DefaultPlan[]{plans[i]}, plans[i].getName() + "-pl"); } final DefaultPriceListSet set = new DefaultPriceListSet(new PriceListDefault(new DefaultPlan[]{plans[0]}), priceList); setPriceLists(set); }
public static MockPlan createBicycleTrialEvergreen1USD() { return new MockPlan("BicycleTrialEvergreen1USD", MockProduct.createBicycle(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public static MockPlan createBicycleTrialEvergreen1USD(final int trialDurationInDays) { return new MockPlan("BicycleTrialEvergreen1USD", MockProduct.createBicycle(), new DefaultPlanPhase[]{MockPlanPhase.createTrial(trialDurationInDays)}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public static MockPlan createPickupTrialEvergreen10USD() { return new MockPlan("PickupTrialEvergreen10USD", MockProduct.createPickup(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.createUSDMonthlyEvergreen("10.00", null), -1); }
public static MockPlan createSportsCarTrialEvergreen100USD() { return new MockPlan("SportsCarTrialEvergreen100USD", MockProduct.createSportsCar(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.createUSDMonthlyEvergreen("100.00", null), -1); }
public static MockPlan createHornMonthlyNoTrial1USD() { return new MockPlan("Horn1USD", MockProduct.createHorn(), new DefaultPlanPhase[]{}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public MockPlan(final MockPlanPhase mockPlanPhase) { setName("Test"); setProduct(MockProduct.createBicycle()); setFinalPhase(mockPlanPhase); mockPlanPhase.setPlan(this); }
public static MockPlan createBicycleNoTrialEvergreen1USD() { return new MockPlan("BicycleNoTrialEvergreen1USD", MockProduct.createBicycle(), new DefaultPlanPhase[]{}, MockPlanPhase.createUSDMonthlyEvergreen("1.0", null), -1); }
public DefaultPlan getPlanFrom(final String priceListName, final Product product, final BillingPeriod period) throws CatalogApiException { DefaultPlan result = null; final DefaultPriceList pl = findPriceListFrom(priceListName); if (pl != null) { result = pl.findPlan(product, period); } if (result != null) { return result; } return defaultPricelist.findPlan(product, period); }
public MockPlanPhase(final Plan plan, final PhaseType phaseType) { setBillingPeriod(BillingPeriod.MONTHLY); setPhaseType(phaseType); setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED)); setRecurringPrice(new MockInternationalPrice()); setFixedPrice(null); setPlan(plan); } }
public static MockPlan createJetTrialFixedTermEvergreen1000USD() { return new MockPlan("JetTrialEvergreen1000USD", MockProduct.createJet(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial(), MockPlanPhase.createUSDMonthlyFixedTerm("500.00", null, 6)}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public static MockPlanPhase createUSDMonthlyFixedTerm(final String reccuringUSDPrice, final String fixedPrice, final int durationInMonths) { return new MockPlanPhase(BillingPeriod.MONTHLY, PhaseType.FIXEDTERM, new DefaultDuration().setUnit(TimeUnit.MONTHS).setNumber(durationInMonths), (reccuringUSDPrice == null) ? null : MockInternationalPrice.createUSD(reccuringUSDPrice), (fixedPrice == null) ? null : MockInternationalPrice.createUSD(fixedPrice)); }