Class: Stripe::V2::Billing::IntentCreateParams::Action::Apply::InvoiceDiscountRule

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/v2/billing/intent_create_params.rb

Defined Under Namespace

Classes: PercentOff

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(applies_to: nil, type: nil, percent_off: nil) ⇒ InvoiceDiscountRule

Returns a new instance of InvoiceDiscountRule.



68
69
70
71
72
# File 'lib/stripe/params/v2/billing/intent_create_params.rb', line 68

def initialize(applies_to: nil, type: nil, percent_off: nil)
  @applies_to = applies_to
  @type = type
  @percent_off = percent_off
end

Instance Attribute Details

#applies_toObject

The entity that the discount rule applies to, for example, the cadence.



62
63
64
# File 'lib/stripe/params/v2/billing/intent_create_params.rb', line 62

def applies_to
  @applies_to
end

#percent_offObject

Configuration for percentage off discount.



66
67
68
# File 'lib/stripe/params/v2/billing/intent_create_params.rb', line 66

def percent_off
  @percent_off
end

#typeObject

Type of the discount rule.



64
65
66
# File 'lib/stripe/params/v2/billing/intent_create_params.rb', line 64

def type
  @type
end

Class Method Details

.field_encodingsObject



74
75
76
77
78
# File 'lib/stripe/params/v2/billing/intent_create_params.rb', line 74

def self.field_encodings
  @field_encodings = {
    percent_off: { kind: :object, fields: { percent_off: :decimal_string } },
  }
end