Class: Recurly::Resources::Coupon
- Inherits:
-
Recurly::Resource
- Object
- Recurly::Resource
- Recurly::Resources::Coupon
- Defined in:
- lib/recurly/resources/coupon.rb
Instance Attribute Summary collapse
-
#applies_to_all_items ⇒ Boolean
The coupon is valid for all items if true.
-
#applies_to_all_plans ⇒ Boolean
The coupon is valid for all plans if true.
-
#applies_to_non_plan_charges ⇒ Boolean
The coupon is valid for one-time, non-plan charges if true.
-
#code ⇒ String
The code the customer enters to redeem the coupon.
-
#coupon_type ⇒ String
Whether the coupon is “single_code” or “bulk”.
-
#created_at ⇒ DateTime
Created at.
-
#discount ⇒ CouponDiscount
Details of the discount a coupon applies.
-
#duration ⇒ String
-
“single_use” coupons applies to the first invoice only.
-
-
#expired_at ⇒ DateTime
The date and time the coupon was expired early or reached its `max_redemptions`.
-
#free_trial_amount ⇒ Integer
Sets the duration of time the `free_trial_unit` is for.
-
#free_trial_unit ⇒ String
Description of the unit of time the coupon is for.
-
#hosted_page_description ⇒ String
This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
-
#id ⇒ String
Coupon ID.
-
#invoice_description ⇒ String
Description of the coupon on the invoice.
-
#items ⇒ Array[ItemMini]
A list of items for which this coupon applies.
-
#max_redemptions ⇒ Integer
A maximum number of redemptions for the coupon.
-
#max_redemptions_per_account ⇒ Integer
Redemptions per account is the number of times a specific account can redeem the coupon.
-
#name ⇒ String
The internal name for the coupon.
-
#object ⇒ String
Object type.
-
#plans ⇒ Array[PlanMini]
A list of plans for which this coupon applies.
-
#redeem_by ⇒ DateTime
The date and time the coupon will expire and can no longer be redeemed.
-
#redemption_resource ⇒ String
Whether the discount is for all eligible charges on the account, or only a specific subscription.
-
#state ⇒ String
Indicates if the coupon is redeemable, and if it is not, why.
-
#temporal_amount ⇒ Integer
If `duration` is “temporal” than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for.
-
#temporal_unit ⇒ String
If `duration` is “temporal” than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for.
-
#unique_code_template ⇒ String
On a bulk coupon, the template from which unique coupon codes are generated.
-
#unique_coupon_code ⇒ Hash
Will be populated when the Coupon being returned is a `UniqueCouponCode`.
-
#unique_coupon_codes_count ⇒ Integer
When this number reaches `max_redemptions` the coupon will no longer be redeemable.
-
#updated_at ⇒ DateTime
Last updated at.
Attributes inherited from Recurly::Resource
Method Summary
Methods inherited from Recurly::Resource
#==, #get_response, #inspect, #requires_client?, #to_json, #to_s
Methods included from Schema::SchemaFactory
Methods included from Schema::ResourceCaster
Methods included from Schema::SchemaValidator
#get_did_you_mean, #validate!, #validate_attribute!
Instance Attribute Details
#applies_to_all_items ⇒ Boolean
Returns The coupon is valid for all items if true. If false then `items` will list the applicable items.
11 |
# File 'lib/recurly/resources/coupon.rb', line 11 define_attribute :applies_to_all_items, :Boolean |
#applies_to_all_plans ⇒ Boolean
Returns The coupon is valid for all plans if true. If false then `plans` will list the applicable plans.
15 |
# File 'lib/recurly/resources/coupon.rb', line 15 define_attribute :applies_to_all_plans, :Boolean |
#applies_to_non_plan_charges ⇒ Boolean
Returns The coupon is valid for one-time, non-plan charges if true.
19 |
# File 'lib/recurly/resources/coupon.rb', line 19 define_attribute :applies_to_non_plan_charges, :Boolean |
#code ⇒ String
Returns The code the customer enters to redeem the coupon.
23 |
# File 'lib/recurly/resources/coupon.rb', line 23 define_attribute :code, String |
#coupon_type ⇒ String
Returns Whether the coupon is “single_code” or “bulk”. Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
27 |
# File 'lib/recurly/resources/coupon.rb', line 27 define_attribute :coupon_type, String |
#created_at ⇒ DateTime
Returns Created at.
31 |
# File 'lib/recurly/resources/coupon.rb', line 31 define_attribute :created_at, DateTime |
#discount ⇒ CouponDiscount
Returns Details of the discount a coupon applies. Will contain a `type` property and one of the following properties: `percent`, `fixed`, `trial`.
35 |
# File 'lib/recurly/resources/coupon.rb', line 35 define_attribute :discount, :CouponDiscount |
#duration ⇒ String
Returns - “single_use” coupons applies to the first invoice only. - “temporal” coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes.
39 |
# File 'lib/recurly/resources/coupon.rb', line 39 define_attribute :duration, String |
#expired_at ⇒ DateTime
Returns The date and time the coupon was expired early or reached its `max_redemptions`.
43 |
# File 'lib/recurly/resources/coupon.rb', line 43 define_attribute :expired_at, DateTime |
#free_trial_amount ⇒ Integer
Returns Sets the duration of time the `free_trial_unit` is for.
47 |
# File 'lib/recurly/resources/coupon.rb', line 47 define_attribute :free_trial_amount, Integer |
#free_trial_unit ⇒ String
Returns Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for.
51 |
# File 'lib/recurly/resources/coupon.rb', line 51 define_attribute :free_trial_unit, String |
#hosted_page_description ⇒ String
Returns This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
55 |
# File 'lib/recurly/resources/coupon.rb', line 55 define_attribute :hosted_page_description, String |
#id ⇒ String
Returns Coupon ID.
59 |
# File 'lib/recurly/resources/coupon.rb', line 59 define_attribute :id, String |
#invoice_description ⇒ String
Returns Description of the coupon on the invoice.
63 |
# File 'lib/recurly/resources/coupon.rb', line 63 define_attribute :invoice_description, String |
#items ⇒ Array[ItemMini]
Returns A list of items for which this coupon applies. This will be `null` if `applies_to_all_items=true`.
67 |
# File 'lib/recurly/resources/coupon.rb', line 67 define_attribute :items, Array, { :item_type => :ItemMini } |
#max_redemptions ⇒ Integer
Returns A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
71 |
# File 'lib/recurly/resources/coupon.rb', line 71 define_attribute :max_redemptions, Integer |
#max_redemptions_per_account ⇒ Integer
Returns Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
75 |
# File 'lib/recurly/resources/coupon.rb', line 75 define_attribute :max_redemptions_per_account, Integer |
#name ⇒ String
Returns The internal name for the coupon.
79 |
# File 'lib/recurly/resources/coupon.rb', line 79 define_attribute :name, String |
#object ⇒ String
Returns Object type.
83 |
# File 'lib/recurly/resources/coupon.rb', line 83 define_attribute :object, String |
#plans ⇒ Array[PlanMini]
Returns A list of plans for which this coupon applies. This will be `null` if `applies_to_all_plans=true`.
87 |
# File 'lib/recurly/resources/coupon.rb', line 87 define_attribute :plans, Array, { :item_type => :PlanMini } |
#redeem_by ⇒ DateTime
Returns The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
91 |
# File 'lib/recurly/resources/coupon.rb', line 91 define_attribute :redeem_by, DateTime |
#redemption_resource ⇒ String
Returns Whether the discount is for all eligible charges on the account, or only a specific subscription.
95 |
# File 'lib/recurly/resources/coupon.rb', line 95 define_attribute :redemption_resource, String |
#state ⇒ String
Returns Indicates if the coupon is redeemable, and if it is not, why.
99 |
# File 'lib/recurly/resources/coupon.rb', line 99 define_attribute :state, String |
#temporal_amount ⇒ Integer
Returns If `duration` is “temporal” than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for.
103 |
# File 'lib/recurly/resources/coupon.rb', line 103 define_attribute :temporal_amount, Integer |
#temporal_unit ⇒ String
Returns If `duration` is “temporal” than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for.
107 |
# File 'lib/recurly/resources/coupon.rb', line 107 define_attribute :temporal_unit, String |
#unique_code_template ⇒ String
Returns On a bulk coupon, the template from which unique coupon codes are generated.
111 |
# File 'lib/recurly/resources/coupon.rb', line 111 define_attribute :unique_code_template, String |
#unique_coupon_code ⇒ Hash
Returns Will be populated when the Coupon being returned is a `UniqueCouponCode`.
115 |
# File 'lib/recurly/resources/coupon.rb', line 115 define_attribute :unique_coupon_code, Hash |
#unique_coupon_codes_count ⇒ Integer
Returns When this number reaches `max_redemptions` the coupon will no longer be redeemable.
119 |
# File 'lib/recurly/resources/coupon.rb', line 119 define_attribute :unique_coupon_codes_count, Integer |
#updated_at ⇒ DateTime
Returns Last updated at.
123 |
# File 'lib/recurly/resources/coupon.rb', line 123 define_attribute :updated_at, DateTime |