killbilling/recurly-java-library — pull request #27 by oohira (2014-01-10 06:01:04+00:00)
Title: Support Coupon Redemption API

I implemented Coupon Redemption API because my application has a requirement to deactivate a coupon and apply another one.

I added following methods to RecurlyClient class according to Recurly API document (http://docs.recurly.com/api/coupons/coupon-redemption). TestRecurlyClient.testRedeemCoupon() method shows how to use these methods.

* RecurlyClient.redeemCoupon()
* POST /v2/coupons/:coupon_code/redeem
* RecurlyClient.getCouponRedemptionByAccount()
* GET /v2/accounts/:account_code/redemption
* RecurlyClient.deleteCouponRedemption()
* DELETE /v2/accounts/:account_code/redemption
* RecurlyClient.getCouponRedemptionByInvoice()
* GET /v2/invoices/:invoice_number/redemption

Also, I implemented coupon deactive API to remove coupons which are created during unit testing.

* RecurlyClient.deleteCoupon()
* DELETE /v2/coupons/:coupon_code

Thanks