use of com.stripe.model.Plan in project stripe-java by stripe.
the class PlanTest method testPlanCreateWithProduct.
@Test
public void testPlanCreateWithProduct() throws StripeException {
Plan plan = Plan.create(defaultPlanWithProductParams);
assertEquals(plan.getInterval(), "month");
assertEquals(plan.getIntervalCount(), (Integer) 2);
assertEquals(plan.getNickname(), defaultPlanWithProductParams.get("nickname"));
assertNotNull(plan.getProduct());
}
use of com.stripe.model.Plan in project stripe-java by stripe.
the class PlanTest method testPlanRetrieve.
@Test
public void testPlanRetrieve() throws StripeException {
Plan createdPlan = Plan.create(getUniquePlanParams());
Plan retrievedPlan = Plan.retrieve(createdPlan.getId());
assertEquals(createdPlan.getId(), retrievedPlan.getId());
}
use of com.stripe.model.Plan in project stripe-java by stripe.
the class PlanTest method testCustomerCreateWithPlan.
@Test
public void testCustomerCreateWithPlan() throws StripeException {
Plan plan = Plan.create(getUniquePlanParams());
Customer customer = createDefaultCustomerWithPlan(plan);
assertEquals(customer.getSubscriptions().getData().get(0).getPlan().getId(), plan.getId());
}
use of com.stripe.model.Plan in project stripe-java by stripe.
the class PlanTest method testPlanDelete.
@Test
public void testPlanDelete() throws StripeException {
Plan createdPlan = Plan.create(getUniquePlanParams());
DeletedPlan deletedPlan = createdPlan.delete();
assertTrue(deletedPlan.getDeleted());
assertEquals(deletedPlan.getId(), createdPlan.getId());
}
use of com.stripe.model.Plan in project stripe-java by stripe.
the class PlanTest method testPlanCreate.
@Test
public void testPlanCreate() throws StripeException {
Plan plan = Plan.create(getUniquePlanParams());
assertEquals(plan.getInterval(), "month");
assertEquals(plan.getIntervalCount(), (Integer) 2);
}
Aggregations