Package com.stripe.model

Examples of com.stripe.model.Invoice


  public void testInvoiceListAndRetrieve() throws StripeException {
    Plan plan = Plan.create(getUniquePlanParams());
    createDefaultCustomerWithPlan(plan);
    Map<String, Object> listParams = new HashMap<String, Object>();
    listParams.put("count", 1);
    Invoice createdInvoice = Invoice.all(listParams).getData().get(0);
    Invoice retrievedInvoice = Invoice.retrieve(createdInvoice.getId());
    assertEquals(createdInvoice.getId(), retrievedInvoice.getId());

    InvoiceLineItemCollection lines = retrievedInvoice.getLines().all(
        listParams);
    assertFalse(lines == null);
  }
View Full Code Here


    Plan plan = Plan.create(getUniquePlanParams());
    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).getData().get(0);
    assertEquals(invoice.getCustomer(), customer.getId());
  }
View Full Code Here

  public void testUpcomingInvoice() throws Exception {
    Customer customer = Customer.create(defaultCustomerParams);
    createDefaultInvoiceItem(customer);
    Map<String, Object> upcomingParams = new HashMap<String, Object>();
    upcomingParams.put("customer", customer.getId());
    Invoice upcomingInvoice = Invoice.upcoming(upcomingParams);
    assertFalse(upcomingInvoice.getAttempted());
  }
View Full Code Here

  public void testUpcomingInvoiceLines() throws Exception {
    Customer customer = Customer.create(defaultCustomerParams);
    InvoiceItem item = createDefaultInvoiceItem(customer);
    Map<String, Object> upcomingParams = new HashMap<String, Object>();
    upcomingParams.put("customer", customer.getId());
    Invoice upcomingInvoice = Invoice.upcoming(upcomingParams);
    assertFalse(upcomingInvoice.getAttempted());

    InvoiceLineItemCollection lines = upcomingInvoice.getLines().all(null);
    assertFalse(lines.getData().isEmpty());
    assertEquals(item.getId(), lines.getData().get(0).getId());

    Map<String, Object> fetchParams = new HashMap<String, Object>();
    fetchParams.put("starting_after", item.getId());
    InvoiceLineItemCollection linesAfterFirst = upcomingInvoice.getLines().all(fetchParams);
    assertTrue(linesAfterFirst.getData().isEmpty());
  }
View Full Code Here

      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);
    Invoice retrievedInvoice = Invoice.retrieve(createdInvoice.getId(),
        Stripe.apiKey);
    assertEquals(createdInvoice.getId(), retrievedInvoice.getId());
  }
View Full Code Here

    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()
        .get(0);
    assertEquals(invoice.getCustomer(), customer.getId());
  }
View Full Code Here

    Customer customer = Customer.create(defaultCustomerParams,
        Stripe.apiKey);
    createDefaultInvoiceItem(customer);
    Map<String, Object> upcomingParams = new HashMap<String, Object>();
    upcomingParams.put("customer", customer.getId());
    Invoice upcomingInvoice = Invoice.upcoming(upcomingParams,
        Stripe.apiKey);
    assertFalse(upcomingInvoice.getAttempted());
  }
View Full Code Here

TOP

Related Classes of com.stripe.model.Invoice

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.