Class: Stripe::CreditNoteService::PreviewParams

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) ⇒ PreviewParams

Returns a new instance of PreviewParams.



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/stripe/services/credit_note_service.rb', line 404

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.



360
361
362
# File 'lib/stripe/services/credit_note_service.rb', line 360

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.



363
364
365
# File 'lib/stripe/services/credit_note_service.rb', line 363

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.



366
367
368
# File 'lib/stripe/services/credit_note_service.rb', line 366

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`.



369
370
371
# File 'lib/stripe/services/credit_note_service.rb', line 369

def email_type
  @email_type
end

#expandObject

Specifies which fields in the response should be expanded.



372
373
374
# File 'lib/stripe/services/credit_note_service.rb', line 372

def expand
  @expand
end

#invoiceObject

ID of the invoice.



375
376
377
# File 'lib/stripe/services/credit_note_service.rb', line 375

def invoice
  @invoice
end

#linesObject

Line items that make up the credit note.



378
379
380
# File 'lib/stripe/services/credit_note_service.rb', line 378

def lines
  @lines
end

#memoObject

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



381
382
383
# File 'lib/stripe/services/credit_note_service.rb', line 381

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`.



384
385
386
# File 'lib/stripe/services/credit_note_service.rb', line 384

def 
  @metadata
end

#out_of_band_amountObject

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



387
388
389
# File 'lib/stripe/services/credit_note_service.rb', line 387

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`



390
391
392
# File 'lib/stripe/services/credit_note_service.rb', line 390

def reason
  @reason
end

#refundObject

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



393
394
395
# File 'lib/stripe/services/credit_note_service.rb', line 393

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.



396
397
398
# File 'lib/stripe/services/credit_note_service.rb', line 396

def refund_amount
  @refund_amount
end

#refundsObject

Refunds to link to this credit note.



399
400
401
# File 'lib/stripe/services/credit_note_service.rb', line 399

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.



402
403
404
# File 'lib/stripe/services/credit_note_service.rb', line 402

def shipping_cost
  @shipping_cost
end