def redeem account_or_code, currency = nil, extra_opts={}
      return false unless link? :redeem

      account_code = if account_or_code.is_a? Account
        account_or_code.account_code
      else
        account_or_code
      end

      redemption_options = {
        :account_code => account_code,
        :currency     => currency || Recurly.default_currency
      }.merge(extra_opts)

      redemption = Redemption.new(redemption_options)

      Redemption.from_response follow_link(:redeem,
        :body => redemption.to_xml
      )
    rescue API::UnprocessableEntity => e
      redemption.apply_errors e
      redemption
    end
def redeem account_or_code, currency = nil, extra_opts={}
      return false unless link? :redeem

      account_code = if account_or_code.is_a? Account
        account_or_code.account_code
      else
        account_or_code
      end

      redemption_options = {
        :account_code => account_code,
        :currency     => currency || Recurly.default_currency
      }.merge(extra_opts)

      redemption = Redemption.new(redemption_options)

      Redemption.from_response follow_link(:redeem,
        :body => redemption.to_xml
      )
    rescue API::UnprocessableEntity => e
      redemption.apply_errors e
      redemption
    end
Redeem a coupon with a given account or account code.

 @return [true]
 @param account_or_code [Account, String]
 @param currency [String] Three-letter currency code
 @param extra_opts [Hash] extra options that go into the {Redemption}
 @example
   coupon = Coupon.find(coupon_code)
   coupon.redeem(account_code, 'USD', subscription_uuid: 'ab3b1dbabc3195')

   coupon = Coupon.find(coupon_code)
   account = Account.find(account_code)
   coupon.redeem(account)