Class: Stripe::CreditNote::PreviewParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/resources/credit_note.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.



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/stripe/resources/credit_note.rb', line 487

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.



443
444
445
# File 'lib/stripe/resources/credit_note.rb', line 443

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.



446
447
448
# File 'lib/stripe/resources/credit_note.rb', line 446

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.



449
450
451
# File 'lib/stripe/resources/credit_note.rb', line 449

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



452
453
454
# File 'lib/stripe/resources/credit_note.rb', line 452

def email_type
  @email_type
end

#expandObject

Specifies which fields in the response should be expanded.



455
456
457
# File 'lib/stripe/resources/credit_note.rb', line 455

def expand
  @expand
end

#invoiceObject

ID of the invoice.



458
459
460
# File 'lib/stripe/resources/credit_note.rb', line 458

def invoice
  @invoice
end

#linesObject

Line items that make up the credit note.



461
462
463
# File 'lib/stripe/resources/credit_note.rb', line 461

def lines
  @lines
end

#memoObject

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



464
465
466
# File 'lib/stripe/resources/credit_note.rb', line 464

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



467
468
469
# File 'lib/stripe/resources/credit_note.rb', line 467

def 
  @metadata
end

#out_of_band_amountObject

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



470
471
472
# File 'lib/stripe/resources/credit_note.rb', line 470

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`



473
474
475
# File 'lib/stripe/resources/credit_note.rb', line 473

def reason
  @reason
end

#refundObject

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



476
477
478
# File 'lib/stripe/resources/credit_note.rb', line 476

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.



479
480
481
# File 'lib/stripe/resources/credit_note.rb', line 479

def refund_amount
  @refund_amount
end

#refundsObject

Refunds to link to this credit note.



482
483
484
# File 'lib/stripe/resources/credit_note.rb', line 482

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.



485
486
487
# File 'lib/stripe/resources/credit_note.rb', line 485

def shipping_cost
  @shipping_cost
end