Sha256: 868674ac035aa06c5da6d57f1d0176021ae41b69d5d093998da408a082a1c3c7

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

module ChargeBee
  class Coupon < Model

  attr_accessor :id, :name, :invoice_name, :discount_type, :discount_percentage, :discount_amount,
  :discount_quantity, :currency_code, :duration_type, :duration_month, :valid_till, :max_redemptions,
  :status, :apply_discount_on, :apply_on, :plan_constraint, :addon_constraint, :created_at, :archived_at,
  :resource_version, :updated_at, :plan_ids, :addon_ids, :redemptions, :invoice_notes, :meta_data

  # OPERATIONS
  #-----------

  def self.create(params, env=nil, headers={})
    Request.send('post', uri_path("coupons"), params, env, headers)
  end

  def self.list(params={}, env=nil, headers={})
    Request.send_list_request('get', uri_path("coupons"), params, env, headers)
  end

  def self.retrieve(id, env=nil, headers={})
    Request.send('get', uri_path("coupons",id.to_s), {}, env, headers)
  end

  def self.delete(id, env=nil, headers={})
    Request.send('post', uri_path("coupons",id.to_s,"delete"), {}, env, headers)
  end

  def self.copy(params, env=nil, headers={})
    Request.send('post', uri_path("coupons","copy"), params, env, headers)
  end

  end # ~Coupon
end # ~ChargeBee

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chargebee-2.2.1 lib/chargebee/models/coupon.rb
chargebee-2.2.0 lib/chargebee/models/coupon.rb
chargebee-2.1.9 lib/chargebee/models/coupon.rb