Class: Stripe::CreditNoteService::CreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/services/credit_note_service.rb

Defined Under Namespace

Classes: Line, Refund, ShippingCost

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(amount: nil, credit_amount: nil, effective_at: nil, email_type: nil, expand: nil, invoice: nil, lines: nil, memo: nil, metadata: nil, out_of_band_amount: nil, reason: nil, refund: nil, refund_amount: nil, refunds: nil, shipping_cost: nil) ⇒ CreateParams

Returns a new instance of CreateParams.



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/stripe/services/credit_note_service.rb', line 209

def initialize(
  amount: nil,
  credit_amount: nil,
  effective_at: nil,
  email_type: nil,
  expand: nil,
  invoice: nil,
  lines: nil,
  memo: nil,
  metadata: nil,
  out_of_band_amount: nil,
  reason: nil,
  refund: nil,
  refund_amount: nil,
  refunds: nil,
  shipping_cost: nil
)
  @amount = amount
  @credit_amount = credit_amount
  @effective_at = effective_at
  @email_type = email_type
  @expand = expand
  @invoice = invoice
  @lines = lines
  @memo = memo
  @metadata = 
  @out_of_band_amount = out_of_band_amount
  @reason = reason
  @refund = refund
  @refund_amount = refund_amount
  @refunds = refunds
  @shipping_cost = shipping_cost
end

Instance Attribute Details

#amountObject

The integer amount in cents (or local equivalent) representing the total amount of the credit note.



165
166
167
# File 'lib/stripe/services/credit_note_service.rb', line 165

def amount
  @amount
end

#credit_amountObject

The integer amount in cents (or local equivalent) representing the amount to credit the customer’s balance, which will be automatically applied to their next invoice.



168
169
170
# File 'lib/stripe/services/credit_note_service.rb', line 168

def credit_amount
  @credit_amount
end

#effective_atObject

The date when this credit note is in effect. Same as ‘created` unless overwritten. When defined, this value replaces the system-generated ’Date of issue’ printed on the credit note PDF.



171
172
173
# File 'lib/stripe/services/credit_note_service.rb', line 171

def effective_at
  @effective_at
end

#email_typeObject

Type of email to send to the customer, one of ‘credit_note` or `none` and the default is `credit_note`.



174
175
176
# File 'lib/stripe/services/credit_note_service.rb', line 174

def email_type
  @email_type
end

#expandObject

Specifies which fields in the response should be expanded.



177
178
179
# File 'lib/stripe/services/credit_note_service.rb', line 177

def expand
  @expand
end

#invoiceObject

ID of the invoice.



180
181
182
# File 'lib/stripe/services/credit_note_service.rb', line 180

def invoice
  @invoice
end

#linesObject

Line items that make up the credit note.



183
184
185
# File 'lib/stripe/services/credit_note_service.rb', line 183

def lines
  @lines
end

#memoObject

The credit note’s memo appears on the credit note PDF.



186
187
188
# File 'lib/stripe/services/credit_note_service.rb', line 186

def memo
  @memo
end

#metadataObject

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.



189
190
191
# File 'lib/stripe/services/credit_note_service.rb', line 189

def 
  @metadata
end

#out_of_band_amountObject

The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.



192
193
194
# File 'lib/stripe/services/credit_note_service.rb', line 192

def out_of_band_amount
  @out_of_band_amount
end

#reasonObject

Reason for issuing this credit note, one of ‘duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`



195
196
197
# File 'lib/stripe/services/credit_note_service.rb', line 195

def reason
  @reason
end

#refundObject

ID of an existing refund to link this credit note to.



198
199
200
# File 'lib/stripe/services/credit_note_service.rb', line 198

def refund
  @refund
end

#refund_amountObject

The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.



201
202
203
# File 'lib/stripe/services/credit_note_service.rb', line 201

def refund_amount
  @refund_amount
end

#refundsObject

Refunds to link to this credit note.



204
205
206
# File 'lib/stripe/services/credit_note_service.rb', line 204

def refunds
  @refunds
end

#shipping_costObject

When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.



207
208
209
# File 'lib/stripe/services/credit_note_service.rb', line 207

def shipping_cost
  @shipping_cost
end