Class: Stripe::Billing::CreditGrantCreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/billing/credit_grant_create_params.rb

Defined Under Namespace

Classes: Amount, ApplicabilityConfig

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(amount: nil, applicability_config: nil, category: nil, customer: nil, customer_account: nil, effective_at: nil, expand: nil, expires_at: nil, metadata: nil, name: nil, priority: nil) ⇒ CreditGrantCreateParams

Returns a new instance of CreditGrantCreateParams.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 117

def initialize(
  amount: nil,
  applicability_config: nil,
  category: nil,
  customer: nil,
  customer_account: nil,
  effective_at: nil,
  expand: nil,
  expires_at: nil,
  metadata: nil,
  name: nil,
  priority: nil
)
  @amount = amount
  @applicability_config = applicability_config
  @category = category
  @customer = customer
  @customer_account = 
  @effective_at = effective_at
  @expand = expand
  @expires_at = expires_at
  @metadata = 
  @name = name
  @priority = priority
end

Instance Attribute Details

#amountObject

Amount of this credit grant.



95
96
97
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 95

def amount
  @amount
end

#applicability_configObject

Configuration specifying what this credit grant applies to. We currently only support ‘metered` prices that have a [Billing Meter](docs.stripe.com/api/billing/meter) attached to them.



97
98
99
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 97

def applicability_config
  @applicability_config
end

#categoryObject

The category of this credit grant. It defaults to ‘paid` if not specified.



99
100
101
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 99

def category
  @category
end

#customerObject

ID of the customer receiving the billing credits.



101
102
103
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 101

def customer
  @customer
end

#customer_accountObject

ID of the account representing the customer receiving the billing credits.



103
104
105
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 103

def 
  @customer_account
end

#effective_atObject

The time when the billing credits become effective-when they’re eligible for use. It defaults to the current timestamp if not specified.



105
106
107
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 105

def effective_at
  @effective_at
end

#expandObject

Specifies which fields in the response should be expanded.



107
108
109
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 107

def expand
  @expand
end

#expires_atObject

The time when the billing credits expire. If not specified, the billing credits don’t expire.



109
110
111
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 109

def expires_at
  @expires_at
end

#metadataObject

Set of key-value pairs that you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.



111
112
113
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 111

def 
  @metadata
end

#nameObject

A descriptive name shown in the Dashboard.



113
114
115
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 113

def name
  @name
end

#priorityObject

The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.



115
116
117
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 115

def priority
  @priority
end

Class Method Details

.field_encodingsObject



143
144
145
146
147
148
149
150
# File 'lib/stripe/params/billing/credit_grant_create_params.rb', line 143

def self.field_encodings
  @field_encodings = {
    amount: {
      kind: :object,
      fields: { custom_pricing_unit: { kind: :object, fields: { value: :decimal_string } } },
    },
  }
end