/** * Creates a random {@link Plan} object for testing use. */ public static Plan createRandomPlan(final String currencyCode) { final Plan plan = createRandomPlan(); plan.setSetupFeeInCents(createRandomSinglePrice(currencyCode)); plan.setUnitAmountInCents(createRandomSinglePrice(currencyCode)); return plan; }
/** * Creates a random {@link Plan} object for testing use. */ public static Plan createRandomPlan(final String currencyCode) { final Plan plan = createRandomPlan(); plan.setSetupFeeInCents(createRandomSinglePrice(currencyCode)); plan.setUnitAmountInCents(createRandomSinglePrice(currencyCode)); return plan; }
/** * Creates a random {@link com.ning.billing.recurly.model.Plan} object for testing use given a seed * * @param seed The RNG seed * @return The random {@link com.ning.billing.recurly.model.Plan} object */ public static Plan createRandomPlan(final int seed) { final Plan plan = new Plan(); plan.setPlanCode(randomAlphaNumericString(10, seed)); plan.setName(randomAlphaNumericString(10, seed)); plan.setPlanIntervalLength(randomInteger(50, seed) + 1); plan.setPlanIntervalUnit("months"); plan.setSetupFeeInCents(createRandomPrice()); plan.setUnitAmountInCents(createRandomPrice()); plan.setDisplayDonationAmounts(true); plan.setDisplayPhoneNumber(true); plan.setDisplayQuantity(true); plan.setBypassHostedConfirmation(true); return plan; }
/** * Creates a random {@link com.ning.billing.recurly.model.Plan} object for testing use given a seed * * @param seed The RNG seed * @return The random {@link com.ning.billing.recurly.model.Plan} object */ public static Plan createRandomPlan(final int seed) { final Plan plan = new Plan(); plan.setPlanCode(randomAlphaNumericString(10, seed)); plan.setName(randomAlphaNumericString(10, seed)); plan.setPlanIntervalLength(randomInteger(50, seed) + 1); plan.setPlanIntervalUnit("months"); plan.setSetupFeeInCents(createRandomPrice()); plan.setUnitAmountInCents(createRandomPrice()); plan.setDisplayDonationAmounts(true); plan.setDisplayPhoneNumber(true); plan.setDisplayQuantity(true); plan.setBypassHostedConfirmation(true); return plan; }