Package com.stripe.model

Examples of com.stripe.model.Customer


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


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

  @Test
  public void testUpcomingInvoicePerCallAPIKey() throws Exception {
    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

  public void testCustomerCreateWithCouponPerCallAPIKey()
      throws StripeException {
    Coupon coupon = Coupon.create(getUniqueCouponParams(), Stripe.apiKey);
    Map<String, Object> customerWithCouponParams = new HashMap<String, Object>();
    customerWithCouponParams.put("coupon", coupon.getId());
    Customer customer = Customer.create(customerWithCouponParams,
        Stripe.apiKey);
    assertEquals(customer.getDiscount().getCoupon().getId(), coupon.getId());

    customer.deleteDiscount();
    assertNull(Customer.retrieve(customer.getId()).getDiscount());
  }
View Full Code Here

    testMetadata(Invoice.create(params));
  }

  @Test
  public void testSubscriptionMetadata() throws StripeException {
    Customer customer = Customer.create(defaultCustomerParams);
    testMetadata(customer.createSubscription(getSubscriptionParams()));
  }
View Full Code Here

TOP

Related Classes of com.stripe.model.Customer

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.