Search in sources :

Example 1 with DeletedCoupon

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

the class CouponTest method testCouponDelete.

@Test
public void testCouponDelete() throws StripeException {
    Coupon createdCoupon = Coupon.create(getUniqueCouponParams());
    DeletedCoupon deletedCoupon = createdCoupon.delete();
    assertTrue(deletedCoupon.getDeleted());
    assertEquals(deletedCoupon.getId(), createdCoupon.getId());
}
Also used : Coupon(com.stripe.model.Coupon) DeletedCoupon(com.stripe.model.DeletedCoupon) DeletedCoupon(com.stripe.model.DeletedCoupon) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Example 2 with DeletedCoupon

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

the class CouponTest method testCouponDeletePerCallAPIKey.

@Test
public void testCouponDeletePerCallAPIKey() throws StripeException {
    Coupon createdCoupon = Coupon.create(getUniqueCouponParams(), Stripe.apiKey);
    DeletedCoupon deletedCoupon = createdCoupon.delete(Stripe.apiKey);
    assertTrue(deletedCoupon.getDeleted());
    assertEquals(deletedCoupon.getId(), createdCoupon.getId());
}
Also used : Coupon(com.stripe.model.Coupon) DeletedCoupon(com.stripe.model.DeletedCoupon) DeletedCoupon(com.stripe.model.DeletedCoupon) BaseStripeFunctionalTest(com.stripe.BaseStripeFunctionalTest) Test(org.junit.Test)

Aggregations

BaseStripeFunctionalTest (com.stripe.BaseStripeFunctionalTest)2 Coupon (com.stripe.model.Coupon)2 DeletedCoupon (com.stripe.model.DeletedCoupon)2 Test (org.junit.Test)2