Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Metrics/MethodLength:
AllowedMethods:
- initialize
- inner_class_types
- field_encodings

Metrics/ModuleLength:
Enabled: false
Expand Down
22 changes: 22 additions & 0 deletions lib/stripe/params/checkout/session_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end
# When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
attr_accessor :adjustable_quantity
Expand Down Expand Up @@ -542,6 +546,12 @@ def initialize(
@quantity = quantity
@tax_rates = tax_rates
end

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

class NameCollection < ::Stripe::RequestParams
Expand Down Expand Up @@ -2600,6 +2610,18 @@ def initialize(
@ui_mode = ui_mode
@wallet_options = wallet_options
end

def self.field_encodings
@field_encodings = {
line_items: {
kind: :array,
element: {
kind: :object,
fields: { price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } } },
},
},
}
end
end
end
end
22 changes: 22 additions & 0 deletions lib/stripe/params/checkout/session_update_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end
# When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
attr_accessor :adjustable_quantity
Expand Down Expand Up @@ -178,6 +182,12 @@ def initialize(
@quantity = quantity
@tax_rates = tax_rates
end

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

class ShippingOption < ::Stripe::RequestParams
Expand Down Expand Up @@ -321,6 +331,18 @@ def initialize(
@metadata = metadata
@shipping_options = shipping_options
end

def self.field_encodings
@field_encodings = {
line_items: {
kind: :array,
element: {
kind: :object,
fields: { price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } } },
},
},
}
end
end
end
end
4 changes: 4 additions & 0 deletions lib/stripe/params/climate/order_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def initialize(
@metric_tons = metric_tons
@product = product
end

def self.field_encodings
@field_encodings = { metric_tons: :decimal_string }
end
end
end
end
13 changes: 13 additions & 0 deletions lib/stripe/params/credit_note_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end

class Refund < ::Stripe::RequestParams
Expand Down Expand Up @@ -161,5 +165,14 @@ def initialize(
@refunds = refunds
@shipping_cost = shipping_cost
end

def self.field_encodings
@field_encodings = {
lines: {
kind: :array,
element: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
},
}
end
end
end
13 changes: 13 additions & 0 deletions lib/stripe/params/credit_note_list_preview_line_items_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end

class Refund < ::Stripe::RequestParams
Expand Down Expand Up @@ -173,5 +177,14 @@ def initialize(
@shipping_cost = shipping_cost
@starting_after = starting_after
end

def self.field_encodings
@field_encodings = {
lines: {
kind: :array,
element: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
},
}
end
end
end
13 changes: 13 additions & 0 deletions lib/stripe/params/credit_note_preview_lines_list_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end

class Refund < ::Stripe::RequestParams
Expand Down Expand Up @@ -173,5 +177,14 @@ def initialize(
@shipping_cost = shipping_cost
@starting_after = starting_after
end

def self.field_encodings
@field_encodings = {
lines: {
kind: :array,
element: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
},
}
end
end
end
13 changes: 13 additions & 0 deletions lib/stripe/params/credit_note_preview_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end

class Refund < ::Stripe::RequestParams
Expand Down Expand Up @@ -161,5 +165,14 @@ def initialize(
@refunds = refunds
@shipping_cost = shipping_cost
end

def self.field_encodings
@field_encodings = {
lines: {
kind: :array,
element: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
},
}
end
end
end
26 changes: 26 additions & 0 deletions lib/stripe/params/invoice_add_lines_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def initialize(
@unit_amount = unit_amount
@unit_amount_decimal = unit_amount_decimal
end

def self.field_encodings
@field_encodings = { unit_amount_decimal: :decimal_string }
end
end

class Pricing < ::Stripe::RequestParams
Expand Down Expand Up @@ -218,6 +222,13 @@ def initialize(
@tax_amounts = tax_amounts
@tax_rates = tax_rates
end

def self.field_encodings
@field_encodings = {
price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
quantity_decimal: :decimal_string,
}
end
end
# Specifies which fields in the response should be expanded.
attr_accessor :expand
Expand All @@ -231,5 +242,20 @@ def initialize(expand: nil, invoice_metadata: nil, lines: nil)
@invoice_metadata = invoice_metadata
@lines = lines
end

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