Search in sources :

Example 1 with DeletedCustomer

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

the class CustomerTest method testCustomerDeletePerCallAPIKey.

@Test
public void testCustomerDeletePerCallAPIKey() throws StripeException {
    Customer createdCustomer = Customer.create(defaultCustomerParams, Stripe.apiKey);
    DeletedCustomer deletedCustomer = createdCustomer.delete(Stripe.apiKey);
    Customer deletedRetrievedCustomer = Customer.retrieve(createdCustomer.getId(), Stripe.apiKey);
    assertTrue(deletedCustomer.getDeleted());
    assertEquals(deletedCustomer.getId(), createdCustomer.getId());
    assertTrue(deletedRetrievedCustomer.getDeleted());
}
Also used : DeletedCustomer(com.stripe.model.DeletedCustomer) Customer(com.stripe.model.Customer) DeletedCustomer(com.stripe.model.DeletedCustomer) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Example 2 with DeletedCustomer

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

the class CustomerTest method testCustomerDelete.

@Test
public void testCustomerDelete() throws StripeException {
    Customer createdCustomer = Customer.create(defaultCustomerParams);
    DeletedCustomer deletedCustomer = createdCustomer.delete();
    Customer deletedRetrievedCustomer = Customer.retrieve(createdCustomer.getId());
    assertTrue(deletedCustomer.getDeleted());
    assertEquals(deletedCustomer.getId(), createdCustomer.getId());
    assertTrue(deletedRetrievedCustomer.getDeleted());
}
Also used : DeletedCustomer(com.stripe.model.DeletedCustomer) Customer(com.stripe.model.Customer) DeletedCustomer(com.stripe.model.DeletedCustomer) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Aggregations

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