Examples of cancelSubscription()


Examples of com.stripe.model.Customer.cancelSubscription()

  @Test
  public void testCancelSubscription() throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams());
    Customer customer = createDefaultCustomerWithPlan(plan);
    assertEquals(customer.getSubscriptions().getData().get(0).getStatus(), "active");
    Subscription canceledSubscription = customer.cancelSubscription();
    assertEquals(canceledSubscription.getStatus(), "canceled");
  }

  @Test
  public void testCancelSubscriptionAtPeriodEnd() throws StripeException {
View Full Code Here

Examples of com.stripe.model.Customer.cancelSubscription()

    Plan plan = Plan.create(getUniquePlanParams());
    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(cancelParams);
    assertEquals(canceledSubscription.getStatus(), "active");
    assertEquals(canceledSubscription.getCancelAtPeriodEnd(), true);
  }
View Full Code Here

Examples of com.stripe.model.Customer.cancelSubscription()

  @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");
  }

  @Test
View Full Code Here

Examples of com.stripe.model.Customer.cancelSubscription()

    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(
        cancelParams, Stripe.apiKey);
    assertEquals(canceledSubscription.getStatus(), "active");
    assertEquals(canceledSubscription.getCancelAtPeriodEnd(), true);
  }
View Full Code Here

Examples of org.jivesoftware.openfire.pubsub.CollectionNode.cancelSubscription()

        // Cancel unsubscriberJID's subscription to recipientJID's PEP service, if it exists.
        CollectionNode rootNode = pepService.getRootCollectionNode();
        NodeSubscription nodeSubscription = rootNode.getSubscription(unsubscriber);
        if (nodeSubscription != null) {
            rootNode.cancelSubscription(nodeSubscription);
        }
    }

    /**
     * Implements UserItemsProvider, adding PEP related items to a disco#items
View Full Code Here

Examples of org.wso2.carbon.upgrade.ui.clients.UpgradeServiceClient.cancelSubscription()

    public static void cancelSubscription(
            ServletConfig config, HttpSession session) throws UIException {

        try {
            UpgradeServiceClient serviceClient = new UpgradeServiceClient(config, session);
            serviceClient.cancelSubscription();
        } catch (Exception e) {
            String msg = "Failed to cancel the current subscription.";
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.