Class: Stripe::CreditNoteCreateParams

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

Defined Under Namespace

Classes: Line, Refund, ShippingCost

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, 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_amount: nil, refunds: nil, shipping_cost: nil) ⇒ CreditNoteCreateParams

Returns a new instance of CreditNoteCreateParams.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/stripe/params/credit_note_create_params.rb', line 137

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_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_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. One of ‘amount`, `lines`, or `shipping_cost` must be provided.



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

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.



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

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.



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

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



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

def email_type
  @email_type
end

#expandObject

Specifies which fields in the response should be expanded.



117
118
119
# File 'lib/stripe/params/credit_note_create_params.rb', line 117

def expand
  @expand
end

#invoiceObject

ID of the invoice.



119
120
121
# File 'lib/stripe/params/credit_note_create_params.rb', line 119

def invoice
  @invoice
end

#linesObject

Line items that make up the credit note. One of ‘amount`, `lines`, or `shipping_cost` must be provided.



121
122
123
# File 'lib/stripe/params/credit_note_create_params.rb', line 121

def lines
  @lines
end

#memoObject

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



123
124
125
# File 'lib/stripe/params/credit_note_create_params.rb', line 123

def memo
  @memo
end

#metadataObject

Set of [key-value pairs](docs.stripe.com/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`.



125
126
127
# File 'lib/stripe/params/credit_note_create_params.rb', line 125

def 
  @metadata
end

#out_of_band_amountObject

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



127
128
129
# File 'lib/stripe/params/credit_note_create_params.rb', line 127

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`



129
130
131
# File 'lib/stripe/params/credit_note_create_params.rb', line 129

def reason
  @reason
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.



131
132
133
# File 'lib/stripe/params/credit_note_create_params.rb', line 131

def refund_amount
  @refund_amount
end

#refundsObject

Refunds to link to this credit note.



133
134
135
# File 'lib/stripe/params/credit_note_create_params.rb', line 133

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. One of ‘amount`, `lines`, or `shipping_cost` must be provided.



135
136
137
# File 'lib/stripe/params/credit_note_create_params.rb', line 135

def shipping_cost
  @shipping_cost
end

Class Method Details

.field_encodingsObject



169
170
171
172
173
174
175
176
# File 'lib/stripe/params/credit_note_create_params.rb', line 169

def self.field_encodings
  @field_encodings = {
    lines: {
      kind: :array,
      element: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
    },
  }
end