@Override public Plan findPlan(final String name, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(name), requestedDate, subscriptionStartDate); return entry.getPlan(); }
private void initializeCatalog(final DefaultVersionedCatalog tenantCatalog) { tenantCatalog.initialize(defaultCatalog.getClock(), tenantCatalog); for (final StandaloneCatalog cur : tenantCatalog.getVersions()) { if (cur instanceof StandaloneCatalogWithPriceOverride) { ((StandaloneCatalogWithPriceOverride) cur).initialize(cur, priceOverride, internalCallContextFactory); } else { cur.initialize(cur); } } }
public MockPlanPhase(final Plan plan, final PhaseType phaseType) { setPhaseType(phaseType); setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED)); setPlan(plan); setFixed(new MockFixed(null)); setRecurring(new MockRecurring(BillingPeriod.MONTHLY, new MockInternationalPrice())); } }
public static MockPlanPhase create1USDMonthlyEvergreen() { return (MockPlanPhase) new MockPlanPhase(BillingPeriod.MONTHLY, PhaseType.EVERGREEN, new DefaultDuration().setUnit(TimeUnit.UNLIMITED).setNumber(-1), 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).setNumber(-1), (reccuringUSDPrice == null) ? null : MockInternationalPrice.createUSD(reccuringUSDPrice), (fixedPrice == null) ? null : MockInternationalPrice.createUSD(fixedPrice)); }
public static MockPlanPhase createTrial(final int days) { return new MockPlanPhase(BillingPeriod.NO_BILLING_PERIOD, PhaseType.TRIAL, new DefaultDuration().setUnit(TimeUnit.DAYS).setNumber(days), null, MockInternationalPrice.create1USD() ); }
public MockPlan(final String planName) { setName(planName); setProduct(new MockProduct()); setFinalPhase(new MockPlanPhase(this)); setInitialPhases(null); setRecurringBillingMode(BillingMode.IN_ADVANCE); setPlansAllowedInBundle(1); }
public static MockPlan createJetTrialEvergreen1000USD() { return new MockPlan("5-JetTrialEvergreen1000USD", MockProduct.createJet(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public MockPlanPhase( final BillingPeriod billingPeriod, final PhaseType type, final DefaultDuration duration, final DefaultInternationalPrice recurringPrice, final DefaultInternationalPrice fixedPrice) { setPhaseType(type); setDuration(duration); setFixed(new MockFixed(fixedPrice)); setRecurring(new MockRecurring(billingPeriod, recurringPrice).setPhase(this)); }
public static MockPlan createBicycleTrialEvergreen1USD(final int trialDurationInDays) { return new MockPlan("1-BicycleTrialEvergreen1USD", MockProduct.createBicycle(), new DefaultPlanPhase[]{MockPlanPhase.createTrial(trialDurationInDays)}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public MockPlan(final MockPlanPhase mockPlanPhase) { setName("Test"); setProduct(MockProduct.createBicycle()); setFinalPhase(mockPlanPhase); setRecurringBillingMode(BillingMode.IN_ADVANCE); mockPlanPhase.setPlan(this); }
public static MockPlan createBicycleTrialEvergreen1USD() { return new MockPlan("1-BicycleTrialEvergreen1USD", MockProduct.createBicycle(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public static MockPlan createHornMonthlyNoTrial1USD() { return new MockPlan("7-Horn1USD", MockProduct.createHorn(), new DefaultPlanPhase[]{}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
public static MockPlan createPickupTrialEvergreen10USD() { return new MockPlan("3-PickupTrialEvergreen10USD", MockProduct.createPickup(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.createUSDMonthlyEvergreen("10.00", null), -1); }
public static MockPlan createSportsCarTrialEvergreen100USD() { return new MockPlan("4-SportsCarTrialEvergreen100USD", MockProduct.createSportsCar(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial()}, MockPlanPhase.createUSDMonthlyEvergreen("100.00", null), -1); }
public static MockPlan createBicycleNoTrialEvergreen1USD() { return new MockPlan("2-BicycleNoTrialEvergreen1USD", MockProduct.createBicycle(), new DefaultPlanPhase[]{}, MockPlanPhase.createUSDMonthlyEvergreen("1.0", null), -1); }
public MockPlanPhase(final MockPlan mockPlan) { setPhaseType(PhaseType.EVERGREEN); setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED)); setPlan(mockPlan); setFixed(new MockFixed(null)); setRecurring(new MockRecurring(BillingPeriod.MONTHLY, new MockInternationalPrice())); }
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)); }
public static MockPlan createJetTrialFixedTermEvergreen1000USD() { return new MockPlan("6-JetTrialEvergreen1000USD", MockProduct.createJet(), new DefaultPlanPhase[]{MockPlanPhase.create30DayTrial(), MockPlanPhase.createUSDMonthlyFixedTerm("500.00", null, 6)}, MockPlanPhase.create1USDMonthlyEvergreen(), -1); }
@Override public Plan createOrFindPlan(final PlanSpecifier spec, final PlanPhasePriceOverridesWithCallContext overrides, final DateTime requestedDate, final DateTime subscriptionStartDate) throws CatalogApiException { final CatalogPlanEntry entry = findCatalogPlanEntry(new PlanRequestWrapper(spec, overrides), requestedDate, subscriptionStartDate); return entry.getPlan(); }