Search in sources :

Example 1 with DeletedInvoiceItem

use of com.stripe.model.DeletedInvoiceItem in project stripe-java by stripe.

the class InvoiceTest method testInvoiceItemDeletePerCallAPIKey.

@Test
public void testInvoiceItemDeletePerCallAPIKey() throws StripeException {
    Customer customer = Customer.create(defaultCustomerParams, Stripe.apiKey);
    InvoiceItem createdInvoiceItem = createDefaultInvoiceItem(customer);
    DeletedInvoiceItem deletedInvoiceItem = createdInvoiceItem.delete(Stripe.apiKey);
    assertTrue(deletedInvoiceItem.getDeleted());
    assertEquals(deletedInvoiceItem.getId(), createdInvoiceItem.getId());
}
Also used : InvoiceItem(com.stripe.model.InvoiceItem) DeletedInvoiceItem(com.stripe.model.DeletedInvoiceItem) Customer(com.stripe.model.Customer) DeletedInvoiceItem(com.stripe.model.DeletedInvoiceItem) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Example 2 with DeletedInvoiceItem

use of com.stripe.model.DeletedInvoiceItem in project stripe-java by stripe.

the class InvoiceTest method testInvoiceItemDelete.

@Test
public void testInvoiceItemDelete() throws StripeException {
    Customer customer = Customer.create(defaultCustomerParams);
    InvoiceItem createdInvoiceItem = createDefaultInvoiceItem(customer);
    DeletedInvoiceItem deletedInvoiceItem = createdInvoiceItem.delete();
    assertTrue(deletedInvoiceItem.getDeleted());
    assertEquals(deletedInvoiceItem.getId(), createdInvoiceItem.getId());
}
Also used : InvoiceItem(com.stripe.model.InvoiceItem) DeletedInvoiceItem(com.stripe.model.DeletedInvoiceItem) Customer(com.stripe.model.Customer) DeletedInvoiceItem(com.stripe.model.DeletedInvoiceItem) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Aggregations

BaseStripeFunctionalTest (com.stripe.BaseStripeFunctionalTest)2 Customer (com.stripe.model.Customer)2 DeletedInvoiceItem (com.stripe.model.DeletedInvoiceItem)2 InvoiceItem (com.stripe.model.InvoiceItem)2 Test (org.junit.Test)2