Package com.stripe.model

Examples of com.stripe.model.Plan


    assertEquals(customer.getSubscriptions().getData().get(0).getPlan().getId(), plan.getId());
  }

  @Test
  public void testUpdateSubscriptionPerCallAPIKey() throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams(), Stripe.apiKey);
    Customer customer = Customer.create(defaultCustomerParams,
        Stripe.apiKey);
    Map<String, Object> subscriptionParams = new HashMap<String, Object>();
    subscriptionParams.put("plan", plan.getId());
    Subscription sub = customer.updateSubscription(subscriptionParams,
        Stripe.apiKey);
    assertEquals(sub.getPlan().getId(), plan.getId());
    assertEquals(sub.getCustomer(), customer.getId());
  }
View Full Code Here


    assertEquals(sub.getCustomer(), customer.getId());
  }

  @Test
  public void testCancelSubscriptionPerCallAPIKey() throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams(), Stripe.apiKey);
    Customer customer = createDefaultCustomerWithPlan(plan);
    assertEquals(customer.getSubscriptions().getData().get(0).getStatus(), "active");
    Subscription canceledSubscription = customer
        .cancelSubscription(Stripe.apiKey);
    assertEquals(canceledSubscription.getStatus(), "canceled");
View Full Code Here

  }

  @Test
  public void testCancelSubscriptionAtPeriodEndPerCallAPIKey()
      throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams(), Stripe.apiKey);
    Customer customer = createDefaultCustomerWithPlan(plan);
    assertEquals(customer.getSubscriptions().getData().get(0).getStatus(), "active");
    Map<String, Object> cancelParams = new HashMap<String, Object>();
    cancelParams.put("at_period_end", true);
    Subscription canceledSubscription = customer.cancelSubscription(
View Full Code Here

  }

  @Test
  public void testInvoiceListAndRetrievePerCallAPIKey()
      throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams(), Stripe.apiKey);
    createDefaultCustomerWithPlan(plan);
    Map<String, Object> listParams = new HashMap<String, Object>();
    listParams.put("count", 1);
    Invoice createdInvoice = Invoice.all(listParams, Stripe.apiKey)
        .getData().get(0);
View Full Code Here

  }

  @Test
  public void testInvoiceRetrieveForCustomerPerCallAPIKey()
      throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams(), Stripe.apiKey);
    Customer customer = createDefaultCustomerWithPlan(plan);
    Map<String, Object> listParams = new HashMap<String, Object>();
    listParams.put("customer", customer.getId());
    listParams.put("count", 1);
    Invoice invoice = Invoice.all(listParams, Stripe.apiKey).getData()
View Full Code Here

TOP

Related Classes of com.stripe.model.Plan

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.