From d9e9828f3605ca1acb869ddb116934aeffadb304 Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Fri, 20 Mar 2026 15:46:54 -0700 Subject: [PATCH 1/2] Add decimal_string coercion for V2 API fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds bidirectional coercion for decimal_string fields, following the same pattern as int64_string: - Encode: Decimal/int/float → str on request serialization - Decode: str → decimal.Decimal on response hydration _coerce_decimal_string added to _encode.py; decimal_string case added to _coerce_value (request path) and _coerce_field_value (response path). Precision is fully preserved through round-trips. Co-Authored-By: Claude Sonnet 4.6 Committed-By-Agent: claude --- stripe/_encode.py | 36 +++++ stripe/_stripe_object.py | 8 +- tests/test_decimal_string.py | 258 +++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 tests/test_decimal_string.py diff --git a/stripe/_encode.py b/stripe/_encode.py index b27749857..65d64ba1f 100644 --- a/stripe/_encode.py +++ b/stripe/_encode.py @@ -2,6 +2,7 @@ import datetime import time from collections import OrderedDict +from decimal import Decimal from typing import Any, Dict, Generator, Mapping, Optional, Tuple, Union @@ -82,6 +83,38 @@ def _coerce_int64_string(value: Any, *, encode: bool) -> Any: return value +def _coerce_decimal_string(value: Any, *, encode: bool) -> Any: + """ + Coerce a decimal_string value in either direction. + + encode=True: Decimal/int/float → str (request serialization) + encode=False: str → Decimal (response hydration) + """ + if value is None: + return None + + if encode: + if isinstance(value, list): + return [ + str(v) + if isinstance(v, (Decimal, int, float)) + and not isinstance(v, bool) + else v + for v in value + ] + if isinstance(value, (Decimal, int, float)) and not isinstance( + value, bool + ): + return str(value) + return value + else: + if isinstance(value, list): + return [Decimal(v) if isinstance(v, str) else v for v in value] + if isinstance(value, str): + return Decimal(value) + return value + + def _coerce_value(value: Any, schema: _SchemaNode) -> Any: """Coerce a single value according to its schema node.""" if value is None: @@ -90,6 +123,9 @@ def _coerce_value(value: Any, schema: _SchemaNode) -> Any: if schema == "int64_string": return _coerce_int64_string(value, encode=True) + if schema == "decimal_string": + return _coerce_decimal_string(value, encode=True) + if isinstance(schema, dict): # Nested object schema if isinstance(value, list): diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 5109cdb29..cd42fb10f 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -27,7 +27,7 @@ StripeStreamResponseAsync, ) from stripe._encode import _encode_datetime # pyright: ignore -from stripe._encode import _coerce_int64_string # pyright: ignore +from stripe._encode import _coerce_int64_string, _coerce_decimal_string # pyright: ignore from stripe._request_options import ( PERSISTENT_OPTIONS_KEYS, extract_options_from_dict, @@ -646,7 +646,8 @@ def _coerce_field_value(self, field_name: str, value: Any) -> Any: Apply field encoding coercion based on _field_encodings metadata. For int64_string fields, converts string values from the API response - to native Python ints. + to native Python ints. For decimal_string fields, converts string + values to decimal.Decimal. """ encoding = self._field_encodings.get(field_name) if encoding is None or value is None: @@ -655,4 +656,7 @@ def _coerce_field_value(self, field_name: str, value: Any) -> Any: if encoding == "int64_string": return _coerce_int64_string(value, encode=False) + if encoding == "decimal_string": + return _coerce_decimal_string(value, encode=False) + return value diff --git a/tests/test_decimal_string.py b/tests/test_decimal_string.py new file mode 100644 index 000000000..3aa6ae992 --- /dev/null +++ b/tests/test_decimal_string.py @@ -0,0 +1,258 @@ +""" +Tests for V2 decimal_string field encoding and decoding. + +V2 API decimal fields are encoded as strings on the wire but exposed as +native Python Decimal values. These tests verify both directions: +- Request serialization: Decimal/int/float → JSON string +- Response hydration: JSON string → Decimal +""" + +from decimal import Decimal + +from stripe._encode import _coerce_decimal_string, _coerce_v2_params +from stripe._stripe_object import StripeObject + + +class TestCoerceDecimalString: + """Tests for the shared bidirectional coercion helper.""" + + def test_encode_decimal_to_str(self): + assert _coerce_decimal_string(Decimal("1.5"), encode=True) == "1.5" + + def test_encode_int_to_str(self): + assert _coerce_decimal_string(100, encode=True) == "100" + + def test_encode_float_to_str(self): + assert _coerce_decimal_string(1.5, encode=True) == "1.5" + + def test_decode_str_to_decimal(self): + result = _coerce_decimal_string("1.5", encode=False) + assert result == Decimal("1.5") + assert isinstance(result, Decimal) + + def test_encode_list(self): + result = _coerce_decimal_string( + [Decimal("1.1"), Decimal("2.2"), Decimal("3.3")], encode=True + ) + assert result == ["1.1", "2.2", "3.3"] + + def test_decode_list(self): + result = _coerce_decimal_string(["1.1", "2.2", "3.3"], encode=False) + assert result == [Decimal("1.1"), Decimal("2.2"), Decimal("3.3")] + assert all(isinstance(v, Decimal) for v in result) + + def test_none_passthrough(self): + assert _coerce_decimal_string(None, encode=True) is None + assert _coerce_decimal_string(None, encode=False) is None + + def test_bool_not_coerced_encode(self): + """Booleans must not be coerced (bool is subclass of int).""" + assert _coerce_decimal_string(True, encode=True) is True + assert _coerce_decimal_string(False, encode=True) is False + + def test_already_str_passthrough_encode(self): + """A string value passes through on encode (already serialized).""" + assert _coerce_decimal_string("1.5", encode=True) == "1.5" + + def test_non_str_passthrough_decode(self): + """Non-string values pass through on decode.""" + assert _coerce_decimal_string(42, encode=False) == 42 + + +class TestDecimalStringPrecision: + """Precision is preserved through the encode/decode round-trip.""" + + def test_high_precision_encode(self): + value = Decimal("1.23456789012345678901234567890") + result = _coerce_decimal_string(value, encode=True) + assert result == "1.23456789012345678901234567890" + + def test_high_precision_decode(self): + result = _coerce_decimal_string( + "1.23456789012345678901234567890", encode=False + ) + assert result == Decimal("1.23456789012345678901234567890") + + def test_round_trip_preserves_precision(self): + original = Decimal("9999999999999999.9999999999999999") + encoded = _coerce_decimal_string(original, encode=True) + decoded = _coerce_decimal_string(encoded, encode=False) + assert decoded == original + + def test_zero(self): + assert _coerce_decimal_string(Decimal("0"), encode=True) == "0" + assert _coerce_decimal_string("0", encode=False) == Decimal("0") + + def test_negative(self): + assert _coerce_decimal_string(Decimal("-1.5"), encode=True) == "-1.5" + assert _coerce_decimal_string("-1.5", encode=False) == Decimal("-1.5") + + +class TestCoerceV2ParamsDecimalString: + """Tests for outbound request coercion (Decimal → str).""" + + def test_top_level_decimal_string(self): + params = {"price": Decimal("9.99")} + schema = {"price": "decimal_string"} + result = _coerce_v2_params(params, schema) + assert result == {"price": "9.99"} + + def test_nested_decimal_string(self): + params = {"item": {"price": Decimal("1.50")}} + schema = {"item": {"price": "decimal_string"}} + result = _coerce_v2_params(params, schema) + assert result == {"item": {"price": "1.50"}} + + def test_array_of_decimal_string(self): + params = {"prices": [Decimal("1.0"), Decimal("2.0"), Decimal("3.0")]} + schema = {"prices": "decimal_string"} + result = _coerce_v2_params(params, schema) + assert result == {"prices": ["1.0", "2.0", "3.0"]} + + def test_array_of_objects_with_decimal_string(self): + params = {"items": [{"price": Decimal("1.00")}, {"price": Decimal("2.00")}]} + schema = {"items": {"price": "decimal_string"}} + result = _coerce_v2_params(params, schema) + assert result == {"items": [{"price": "1.00"}, {"price": "2.00"}]} + + def test_unrelated_fields_unchanged(self): + params = {"name": "test", "count": 42, "price": Decimal("9.99")} + schema = {"price": "decimal_string"} + result = _coerce_v2_params(params, schema) + assert result == {"name": "test", "count": 42, "price": "9.99"} + + def test_none_params_returns_none(self): + schema = {"price": "decimal_string"} + result = _coerce_v2_params(None, schema) + assert result is None + + def test_none_value_preserved(self): + params = {"price": None} + schema = {"price": "decimal_string"} + result = _coerce_v2_params(params, schema) + assert result == {"price": None} + + def test_int_value_coerced(self): + """int values are also accepted as decimal_string inputs.""" + params = {"price": 10} + schema = {"price": "decimal_string"} + result = _coerce_v2_params(params, schema) + assert result == {"price": "10"} + + def test_mixed_decimal_and_int64(self): + params = {"price": Decimal("9.99"), "quantity": 5} + schema = {"price": "decimal_string", "quantity": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"price": "9.99", "quantity": "5"} + + +class TestResponseFieldCoercion: + """Tests for inbound response coercion (str → Decimal) via _field_encodings.""" + + def _make_v2_class(self, field_encodings): + """Create a StripeObject subclass with given field encodings.""" + + class V2Resource(StripeObject): + _field_encodings = field_encodings + + return V2Resource + + def test_top_level_decimal_string_response(self): + cls = self._make_v2_class({"price": "decimal_string"}) + obj = cls.construct_from( + {"id": "test", "price": "9.99"}, + key="sk_test", + api_mode="V2", + ) + assert obj["price"] == Decimal("9.99") + assert isinstance(obj["price"], Decimal) + + def test_array_of_decimal_string_response(self): + cls = self._make_v2_class({"prices": "decimal_string"}) + obj = cls.construct_from( + {"id": "test", "prices": ["1.0", "2.0", "3.0"]}, + key="sk_test", + api_mode="V2", + ) + assert obj["prices"] == [Decimal("1.0"), Decimal("2.0"), Decimal("3.0")] + assert all(isinstance(v, Decimal) for v in obj["prices"]) + + def test_unrelated_fields_unchanged_response(self): + cls = self._make_v2_class({"price": "decimal_string"}) + obj = cls.construct_from( + {"id": "test", "name": "hello", "price": "9.99"}, + key="sk_test", + api_mode="V2", + ) + assert obj["name"] == "hello" + assert isinstance(obj["name"], str) + assert obj["price"] == Decimal("9.99") + + def test_none_value_preserved_response(self): + cls = self._make_v2_class({"price": "decimal_string"}) + obj = cls.construct_from( + {"id": "test", "price": None}, + key="sk_test", + api_mode="V2", + ) + assert obj["price"] is None + + def test_no_field_encodings_unchanged(self): + """StripeObject without _field_encodings leaves strings as strings.""" + obj = StripeObject.construct_from( + {"id": "test", "price": "9.99"}, + key="sk_test", + api_mode="V2", + ) + assert obj["price"] == "9.99" + assert isinstance(obj["price"], str) + + def test_high_precision_response(self): + cls = self._make_v2_class({"rate": "decimal_string"}) + obj = cls.construct_from( + {"id": "test", "rate": "0.00123456789012345678"}, + key="sk_test", + api_mode="V2", + ) + assert obj["rate"] == Decimal("0.00123456789012345678") + + def test_negative_response(self): + cls = self._make_v2_class({"balance": "decimal_string"}) + obj = cls.construct_from( + {"id": "test", "balance": "-100.50"}, + key="sk_test", + api_mode="V2", + ) + assert obj["balance"] == Decimal("-100.50") + + +class TestV1Unchanged: + """Regression tests: V1 behavior should not be affected.""" + + def test_v1_integer_fields_stay_integers(self): + """V1 objects don't have decimal _field_encodings, so ints stay ints.""" + obj = StripeObject.construct_from( + {"id": "test", "amount": 100}, + key="sk_test", + api_mode="V1", + ) + assert obj["amount"] == 100 + assert isinstance(obj["amount"], int) + + def test_v1_string_fields_stay_strings(self): + obj = StripeObject.construct_from( + {"id": "test", "name": "hello"}, + key="sk_test", + api_mode="V1", + ) + assert obj["name"] == "hello" + assert isinstance(obj["name"], str) + + def test_object_without_field_encodings_unchanged(self): + """Objects without decimal _field_encodings are unaffected.""" + obj = StripeObject.construct_from( + {"id": "test", "price": "9.99", "count": 42}, + key="sk_test", + ) + assert obj["price"] == "9.99" + assert obj["count"] == 42 From ad39e3fea40f878a2ccaa5bc7687287345a27556 Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Fri, 20 Mar 2026 18:40:09 -0700 Subject: [PATCH 2/2] [decimal-tier2] Regen: emit decimal_string _field_encodings for v1 and v2 resources Co-Authored-By: Claude Sonnet 4.6 Committed-By-Agent: claude --- stripe/_credit_note_line_item.py | 4 ++- stripe/_invoice_item.py | 7 +++-- stripe/_invoice_line_item.py | 7 +++-- stripe/_plan.py | 12 ++++++--- stripe/_price.py | 23 +++++++++++----- stripe/checkout/_session.py | 4 ++- stripe/climate/_order.py | 4 ++- stripe/climate/_product.py | 4 ++- stripe/issuing/_authorization.py | 23 +++++++++++----- stripe/issuing/_transaction.py | 27 ++++++++++++++----- stripe/params/_credit_note_create_params.py | 3 ++- .../_credit_note_preview_lines_list_params.py | 3 ++- .../_credit_note_preview_lines_params.py | 3 ++- stripe/params/_credit_note_preview_params.py | 3 ++- stripe/params/_invoice_add_lines_params.py | 5 ++-- .../params/_invoice_create_preview_params.py | 13 ++++----- stripe/params/_invoice_item_create_params.py | 7 ++--- stripe/params/_invoice_item_modify_params.py | 7 ++--- stripe/params/_invoice_item_update_params.py | 7 ++--- .../_invoice_line_item_update_params.py | 5 ++-- stripe/params/_invoice_update_lines_params.py | 5 ++-- stripe/params/_payment_link_create_params.py | 3 ++- stripe/params/_plan_create_params.py | 7 ++--- stripe/params/_price_create_params.py | 13 ++++----- stripe/params/_price_modify_params.py | 7 ++--- stripe/params/_price_update_params.py | 7 ++--- stripe/params/_product_create_params.py | 9 ++++--- stripe/params/_quote_create_params.py | 3 ++- stripe/params/_quote_modify_params.py | 3 ++- stripe/params/_quote_update_params.py | 3 ++- stripe/params/_subscription_create_params.py | 5 ++-- .../_subscription_item_create_params.py | 3 ++- .../_subscription_item_modify_params.py | 3 ++- .../_subscription_item_update_params.py | 3 ++- stripe/params/_subscription_modify_params.py | 5 ++-- .../_subscription_schedule_create_params.py | 5 ++-- .../_subscription_schedule_modify_params.py | 5 ++-- .../_subscription_schedule_update_params.py | 5 ++-- stripe/params/_subscription_update_params.py | 5 ++-- .../params/checkout/_session_create_params.py | 3 ++- .../params/checkout/_session_modify_params.py | 3 ++- .../params/checkout/_session_update_params.py | 3 ++- stripe/params/climate/_order_create_params.py | 3 ++- .../issuing/_authorization_capture_params.py | 15 ++++++----- .../issuing/_authorization_create_params.py | 13 ++++----- .../_authorization_finalize_amount_params.py | 13 ++++----- ...transaction_create_force_capture_params.py | 15 ++++++----- ...ansaction_create_unlinked_refund_params.py | 15 ++++++----- .../issuing/_authorization_capture_params.py | 15 ++++++----- .../issuing/_authorization_create_params.py | 13 ++++----- .../_authorization_finalize_amount_params.py | 13 ++++----- ...transaction_create_force_capture_params.py | 15 ++++++----- ...ansaction_create_unlinked_refund_params.py | 15 ++++++----- .../params/v2/core/_account_create_params.py | 3 ++- .../v2/core/_account_token_create_params.py | 3 ++- .../params/v2/core/_account_update_params.py | 3 ++- .../v2/core/accounts/_person_create_params.py | 3 ++- .../accounts/_person_token_create_params.py | 3 ++- .../v2/core/accounts/_person_update_params.py | 3 ++- stripe/v2/core/_account.py | 4 ++- stripe/v2/core/_account_person.py | 4 ++- tests/test_decimal_string.py | 10 +++++-- 62 files changed, 288 insertions(+), 172 deletions(-) diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 68948f055..d48fba5b2 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, List, Optional @@ -162,7 +163,7 @@ class TaxRateDetails(StripeObject): """ The cost of each unit of product being credited. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -171,3 +172,4 @@ class TaxRateDetails(StripeObject): "pretax_credit_amounts": PretaxCreditAmount, "taxes": Tax, } + _field_encodings = {"unit_amount_decimal": "decimal_string"} diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index b507ee8ae..020b938d8 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -99,11 +100,12 @@ class PriceDetails(StripeObject): """ The type of the pricing details. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places. """ _inner_class_types = {"price_details": PriceDetails} + _field_encodings = {"unit_amount_decimal": "decimal_string"} class ProrationDetails(StripeObject): class DiscountAmount(StripeObject): @@ -200,7 +202,7 @@ class DiscountAmount(StripeObject): """ Quantity of units for the invoice item in integer format, with any decimal precision truncated. For the item's full-precision decimal quantity, use `quantity_decimal`. This field will be deprecated in favor of `quantity_decimal` in a future version. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. """ - quantity_decimal: str + quantity_decimal: Decimal """ Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. """ @@ -445,3 +447,4 @@ async def retrieve_async( "pricing": Pricing, "proration_details": ProrationDetails, } + _field_encodings = {"quantity_decimal": "decimal_string"} diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 190863831..4e1d82b94 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource @@ -175,11 +176,12 @@ class PriceDetails(StripeObject): """ The type of the pricing details. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places. """ _inner_class_types = {"price_details": PriceDetails} + _field_encodings = {"unit_amount_decimal": "decimal_string"} class Tax(StripeObject): class TaxRateDetails(StripeObject): @@ -292,7 +294,7 @@ class TaxRateDetails(StripeObject): """ Quantity of units for the invoice line item in integer format, with any decimal precision truncated. For the line item's full-precision decimal quantity, use `quantity_decimal`. This field will be deprecated in favor of `quantity_decimal` in a future version. If the line item is a proration or subscription, the quantity of the subscription that the proration was computed for. """ - quantity_decimal: Optional[str] + quantity_decimal: Optional[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ @@ -360,3 +362,4 @@ async def modify_async( "pricing": Pricing, "taxes": Tax, } + _field_encodings = {"quantity_decimal": "decimal_string"} diff --git a/stripe/_plan.py b/stripe/_plan.py index fbf1c59e2..e747a143b 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField @@ -44,7 +45,7 @@ class Tier(StripeObject): """ Price for the entire tier. """ - flat_amount_decimal: Optional[str] + flat_amount_decimal: Optional[Decimal] """ Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -52,7 +53,7 @@ class Tier(StripeObject): """ Per unit price for units relevant to the tier. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -60,6 +61,10 @@ class Tier(StripeObject): """ Up to and including to this quantity will be contained in the tier. """ + _field_encodings = { + "flat_amount_decimal": "decimal_string", + "unit_amount_decimal": "decimal_string", + } class TransformUsage(StripeObject): divide_by: int @@ -79,7 +84,7 @@ class TransformUsage(StripeObject): """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. """ - amount_decimal: Optional[str] + amount_decimal: Optional[Decimal] """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ @@ -373,3 +378,4 @@ async def retrieve_async( return instance _inner_class_types = {"tiers": Tier, "transform_usage": TransformUsage} + _field_encodings = {"amount_decimal": "decimal_string"} diff --git a/stripe/_price.py b/stripe/_price.py index 79e83621f..58ded458b 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -66,7 +67,7 @@ class Tier(StripeObject): """ Price for the entire tier. """ - flat_amount_decimal: Optional[str] + flat_amount_decimal: Optional[Decimal] """ Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -74,7 +75,7 @@ class Tier(StripeObject): """ Per unit price for units relevant to the tier. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -82,6 +83,10 @@ class Tier(StripeObject): """ Up to and including to this quantity will be contained in the tier. """ + _field_encodings = { + "flat_amount_decimal": "decimal_string", + "unit_amount_decimal": "decimal_string", + } custom_unit_amount: Optional[CustomUnitAmount] """ @@ -101,7 +106,7 @@ class Tier(StripeObject): """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ @@ -109,6 +114,7 @@ class Tier(StripeObject): "custom_unit_amount": CustomUnitAmount, "tiers": Tier, } + _field_encodings = {"unit_amount_decimal": "decimal_string"} class CustomUnitAmount(StripeObject): maximum: Optional[int] @@ -151,7 +157,7 @@ class Tier(StripeObject): """ Price for the entire tier. """ - flat_amount_decimal: Optional[str] + flat_amount_decimal: Optional[Decimal] """ Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -159,7 +165,7 @@ class Tier(StripeObject): """ Per unit price for units relevant to the tier. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ @@ -167,6 +173,10 @@ class Tier(StripeObject): """ Up to and including to this quantity will be contained in the tier. """ + _field_encodings = { + "flat_amount_decimal": "decimal_string", + "unit_amount_decimal": "decimal_string", + } class TransformQuantity(StripeObject): divide_by: int @@ -262,7 +272,7 @@ class TransformQuantity(StripeObject): """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. """ - unit_amount_decimal: Optional[str] + unit_amount_decimal: Optional[Decimal] """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ @@ -434,3 +444,4 @@ async def search_auto_paging_iter_async( "tiers": Tier, "transform_quantity": TransformQuantity, } + _field_encodings = {"unit_amount_decimal": "decimal_string"} diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 0729edd7b..f9ab42b81 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -286,7 +287,7 @@ class CurrencyConversion(StripeObject): """ Total of all items in source currency after discounts and taxes are applied. """ - fx_rate: str + fx_rate: Decimal """ Exchange rate used to convert source currency amounts to customer currency amounts """ @@ -294,6 +295,7 @@ class CurrencyConversion(StripeObject): """ Creation currency of the CheckoutSession before localization """ + _field_encodings = {"fx_rate": "decimal_string"} class CustomField(StripeObject): class Dropdown(StripeObject): diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 1f7acab6e..a162d7e51 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject @@ -152,7 +153,7 @@ class Location(StripeObject): """ Set of [key-value pairs](https://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. """ - metric_tons: str + metric_tons: Decimal """ Quantity of carbon removal that is included in this order. """ @@ -435,3 +436,4 @@ async def retrieve_async( "beneficiary": Beneficiary, "delivery_details": DeliveryDetail, } + _field_encodings = {"metric_tons": "decimal_string"} diff --git a/stripe/climate/_product.py b/stripe/climate/_product.py index 613352ec9..1c833cc4d 100644 --- a/stripe/climate/_product.py +++ b/stripe/climate/_product.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject @@ -58,7 +59,7 @@ class CurrentPricesPerMetricTon(StripeObject): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - metric_tons_available: str + metric_tons_available: Decimal """ The quantity of metric tons available for reservation. """ @@ -140,3 +141,4 @@ async def retrieve_async( _inner_class_types = { "current_prices_per_metric_ton": CurrentPricesPerMetricTon, } + _field_encodings = {"metric_tons_available": "decimal_string"} diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index e892cda27..7045e6e66 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource @@ -109,26 +110,32 @@ class CardholderPromptData(StripeObject): class ReportedBreakdown(StripeObject): class Fuel(StripeObject): - gross_amount_decimal: Optional[str] + gross_amount_decimal: Optional[Decimal] """ Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes. """ + _field_encodings = {"gross_amount_decimal": "decimal_string"} class NonFuel(StripeObject): - gross_amount_decimal: Optional[str] + gross_amount_decimal: Optional[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ + _field_encodings = {"gross_amount_decimal": "decimal_string"} class Tax(StripeObject): - local_amount_decimal: Optional[str] + local_amount_decimal: Optional[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. `null` if not reported by merchant or not subject to tax. """ - national_amount_decimal: Optional[str] + national_amount_decimal: Optional[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. `null` if not reported by merchant or not subject to tax. """ + _field_encodings = { + "local_amount_decimal": "decimal_string", + "national_amount_decimal": "decimal_string", + } fuel: Optional[Fuel] """ @@ -200,7 +207,7 @@ class Fuel(StripeObject): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: Optional[str] + quantity_decimal: Optional[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -231,10 +238,14 @@ class Fuel(StripeObject): """ The units for `quantity_decimal`. """ - unit_cost_decimal: Optional[str] + unit_cost_decimal: Optional[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ + _field_encodings = { + "quantity_decimal": "decimal_string", + "unit_cost_decimal": "decimal_string", + } class MerchantData(StripeObject): category: str diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index bf19b202e..1794fa83b 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource @@ -149,26 +150,36 @@ class CardholderPromptData(StripeObject): class ReportedBreakdown(StripeObject): class Fuel(StripeObject): - gross_amount_decimal: Optional[str] + gross_amount_decimal: Optional[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ + _field_encodings = { + "gross_amount_decimal": "decimal_string", + } class NonFuel(StripeObject): - gross_amount_decimal: Optional[str] + gross_amount_decimal: Optional[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ + _field_encodings = { + "gross_amount_decimal": "decimal_string", + } class Tax(StripeObject): - local_amount_decimal: Optional[str] + local_amount_decimal: Optional[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: Optional[str] + national_amount_decimal: Optional[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ + _field_encodings = { + "local_amount_decimal": "decimal_string", + "national_amount_decimal": "decimal_string", + } fuel: Optional[Fuel] """ @@ -263,7 +274,7 @@ class Fuel(StripeObject): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: Optional[str] + quantity_decimal: Optional[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -275,10 +286,14 @@ class Fuel(StripeObject): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: str + unit_cost_decimal: Decimal """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ + _field_encodings = { + "quantity_decimal": "decimal_string", + "unit_cost_decimal": "decimal_string", + } class Lodging(StripeObject): check_in_at: Optional[int] diff --git a/stripe/params/_credit_note_create_params.py b/stripe/params/_credit_note_create_params.py index 4fa2d3df4..19ce88e55 100644 --- a/stripe/params/_credit_note_create_params.py +++ b/stripe/params/_credit_note_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -107,7 +108,7 @@ class CreditNoteCreateParamsLine(TypedDict): """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_credit_note_preview_lines_list_params.py b/stripe/params/_credit_note_preview_lines_list_params.py index dac37c266..0ee707384 100644 --- a/stripe/params/_credit_note_preview_lines_list_params.py +++ b/stripe/params/_credit_note_preview_lines_list_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -118,7 +119,7 @@ class CreditNotePreviewLinesListParamsLine(TypedDict): """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_credit_note_preview_lines_params.py b/stripe/params/_credit_note_preview_lines_params.py index 60016514a..6ee23dca7 100644 --- a/stripe/params/_credit_note_preview_lines_params.py +++ b/stripe/params/_credit_note_preview_lines_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -119,7 +120,7 @@ class CreditNotePreviewLinesParamsLine(TypedDict): """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_credit_note_preview_params.py b/stripe/params/_credit_note_preview_params.py index 484a3fdaf..2ade5bea8 100644 --- a/stripe/params/_credit_note_preview_params.py +++ b/stripe/params/_credit_note_preview_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -107,7 +108,7 @@ class CreditNotePreviewParamsLine(TypedDict): """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_add_lines_params.py b/stripe/params/_invoice_add_lines_params.py index f203b2f67..36d4d2a01 100644 --- a/stripe/params/_invoice_add_lines_params.py +++ b/stripe/params/_invoice_add_lines_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -63,7 +64,7 @@ class InvoiceAddLinesParamsLine(TypedDict): """ Non-negative integer. The quantity of units for the line item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ @@ -126,7 +127,7 @@ class InvoiceAddLinesParamsLinePriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index 8a0453849..c691e7c49 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -385,7 +386,7 @@ class InvoiceCreatePreviewParamsInvoiceItem(TypedDict): """ Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. """ @@ -405,7 +406,7 @@ class InvoiceCreatePreviewParamsInvoiceItem(TypedDict): """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -454,7 +455,7 @@ class InvoiceCreatePreviewParamsInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -739,7 +740,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -928,7 +929,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -1139,7 +1140,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_item_create_params.py b/stripe/params/_invoice_item_create_params.py index d95496d92..27c5ef63b 100644 --- a/stripe/params/_invoice_item_create_params.py +++ b/stripe/params/_invoice_item_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -62,7 +63,7 @@ class InvoiceItemCreateParams(RequestOptions): """ Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. """ @@ -82,7 +83,7 @@ class InvoiceItemCreateParams(RequestOptions): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ @@ -131,7 +132,7 @@ class InvoiceItemCreateParamsPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_item_modify_params.py b/stripe/params/_invoice_item_modify_params.py index d3229f9f4..d6ed2df44 100644 --- a/stripe/params/_invoice_item_modify_params.py +++ b/stripe/params/_invoice_item_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -46,7 +47,7 @@ class InvoiceItemModifyParams(RequestOptions): """ Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ @@ -62,7 +63,7 @@ class InvoiceItemModifyParams(RequestOptions): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ @@ -111,7 +112,7 @@ class InvoiceItemModifyParamsPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_item_update_params.py b/stripe/params/_invoice_item_update_params.py index 46bd42a41..d1e817a37 100644 --- a/stripe/params/_invoice_item_update_params.py +++ b/stripe/params/_invoice_item_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -45,7 +46,7 @@ class InvoiceItemUpdateParams(TypedDict): """ Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ @@ -61,7 +62,7 @@ class InvoiceItemUpdateParams(TypedDict): """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. """ @@ -110,7 +111,7 @@ class InvoiceItemUpdateParamsPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_line_item_update_params.py b/stripe/params/_invoice_line_item_update_params.py index 523edb596..21fe53fb6 100644 --- a/stripe/params/_invoice_line_item_update_params.py +++ b/stripe/params/_invoice_line_item_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -47,7 +48,7 @@ class InvoiceLineItemUpdateParams(TypedDict): """ Non-negative integer. The quantity of units for the line item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ @@ -112,7 +113,7 @@ class InvoiceLineItemUpdateParamsPriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_invoice_update_lines_params.py b/stripe/params/_invoice_update_lines_params.py index 49659765f..c310a24e2 100644 --- a/stripe/params/_invoice_update_lines_params.py +++ b/stripe/params/_invoice_update_lines_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -63,7 +64,7 @@ class InvoiceUpdateLinesParamsLine(TypedDict): """ Non-negative integer. The quantity of units for the line item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ @@ -128,7 +129,7 @@ class InvoiceUpdateLinesParamsLinePriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_payment_link_create_params.py b/stripe/params/_payment_link_create_params.py index 9b2ec6a51..d9fd26434 100644 --- a/stripe/params/_payment_link_create_params.py +++ b/stripe/params/_payment_link_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -573,7 +574,7 @@ class PaymentLinkCreateParamsLineItemPriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_plan_create_params.py b/stripe/params/_plan_create_params.py index d3cdabcdf..9022dc775 100644 --- a/stripe/params/_plan_create_params.py +++ b/stripe/params/_plan_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -14,7 +15,7 @@ class PlanCreateParams(RequestOptions): """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. """ - amount_decimal: NotRequired[str] + amount_decimal: NotRequired[Decimal] """ Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. """ @@ -115,7 +116,7 @@ class PlanCreateParamsTier(TypedDict): """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired[str] + flat_amount_decimal: NotRequired[Decimal] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ @@ -123,7 +124,7 @@ class PlanCreateParamsTier(TypedDict): """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_price_create_params.py b/stripe/params/_price_create_params.py index b584425ca..d3722c4a2 100644 --- a/stripe/params/_price_create_params.py +++ b/stripe/params/_price_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -80,7 +81,7 @@ class PriceCreateParams(RequestOptions): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -105,7 +106,7 @@ class PriceCreateParamsCurrencyOptions(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -135,7 +136,7 @@ class PriceCreateParamsCurrencyOptionsTier(TypedDict): """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired[str] + flat_amount_decimal: NotRequired[Decimal] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ @@ -143,7 +144,7 @@ class PriceCreateParamsCurrencyOptionsTier(TypedDict): """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -233,7 +234,7 @@ class PriceCreateParamsTier(TypedDict): """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired[str] + flat_amount_decimal: NotRequired[Decimal] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ @@ -241,7 +242,7 @@ class PriceCreateParamsTier(TypedDict): """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_price_modify_params.py b/stripe/params/_price_modify_params.py index 6a5310928..cc84e53a8 100644 --- a/stripe/params/_price_modify_params.py +++ b/stripe/params/_price_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -61,7 +62,7 @@ class PriceModifyParamsCurrencyOptions(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -91,7 +92,7 @@ class PriceModifyParamsCurrencyOptionsTier(TypedDict): """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired[str] + flat_amount_decimal: NotRequired[Decimal] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ @@ -99,7 +100,7 @@ class PriceModifyParamsCurrencyOptionsTier(TypedDict): """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_price_update_params.py b/stripe/params/_price_update_params.py index 3176bfc00..e78352af0 100644 --- a/stripe/params/_price_update_params.py +++ b/stripe/params/_price_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -60,7 +61,7 @@ class PriceUpdateParamsCurrencyOptions(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -90,7 +91,7 @@ class PriceUpdateParamsCurrencyOptionsTier(TypedDict): """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired[str] + flat_amount_decimal: NotRequired[Decimal] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ @@ -98,7 +99,7 @@ class PriceUpdateParamsCurrencyOptionsTier(TypedDict): """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_product_create_params.py b/stripe/params/_product_create_params.py index d8fb6cbb1..080ffd6f4 100644 --- a/stripe/params/_product_create_params.py +++ b/stripe/params/_product_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -110,7 +111,7 @@ class ProductCreateParamsDefaultPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -137,7 +138,7 @@ class ProductCreateParamsDefaultPriceDataCurrencyOptions(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -169,7 +170,7 @@ class ProductCreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ - flat_amount_decimal: NotRequired[str] + flat_amount_decimal: NotRequired[Decimal] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ @@ -177,7 +178,7 @@ class ProductCreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): """ The per unit billing amount for each individual unit for which this tier applies. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_quote_create_params.py b/stripe/params/_quote_create_params.py index 9b0cd5db6..374b0b68b 100644 --- a/stripe/params/_quote_create_params.py +++ b/stripe/params/_quote_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -225,7 +226,7 @@ class QuoteCreateParamsLineItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_quote_modify_params.py b/stripe/params/_quote_modify_params.py index 734b030d4..b6a6534b1 100644 --- a/stripe/params/_quote_modify_params.py +++ b/stripe/params/_quote_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -210,7 +211,7 @@ class QuoteModifyParamsLineItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_quote_update_params.py b/stripe/params/_quote_update_params.py index 71481477a..e3b3acfaa 100644 --- a/stripe/params/_quote_update_params.py +++ b/stripe/params/_quote_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -209,7 +210,7 @@ class QuoteUpdateParamsLineItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index 6ed882ec9..f5d88418b 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -277,7 +278,7 @@ class SubscriptionCreateParamsAddInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -476,7 +477,7 @@ class SubscriptionCreateParamsItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_item_create_params.py b/stripe/params/_subscription_item_create_params.py index a940e6fc3..8627eef54 100644 --- a/stripe/params/_subscription_item_create_params.py +++ b/stripe/params/_subscription_item_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -122,7 +123,7 @@ class SubscriptionItemCreateParamsPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_item_modify_params.py b/stripe/params/_subscription_item_modify_params.py index 66c061369..408b22f74 100644 --- a/stripe/params/_subscription_item_modify_params.py +++ b/stripe/params/_subscription_item_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -122,7 +123,7 @@ class SubscriptionItemModifyParamsPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_item_update_params.py b/stripe/params/_subscription_item_update_params.py index fb0394d65..bbd0d5b4c 100644 --- a/stripe/params/_subscription_item_update_params.py +++ b/stripe/params/_subscription_item_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -121,7 +122,7 @@ class SubscriptionItemUpdateParamsPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index 88e5074e2..7bbaad4d5 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -263,7 +264,7 @@ class SubscriptionModifyParamsAddInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -446,7 +447,7 @@ class SubscriptionModifyParamsItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_schedule_create_params.py b/stripe/params/_subscription_schedule_create_params.py index 48a8b9a5d..60682433b 100644 --- a/stripe/params/_subscription_schedule_create_params.py +++ b/stripe/params/_subscription_schedule_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -412,7 +413,7 @@ class SubscriptionScheduleCreateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -591,7 +592,7 @@ class SubscriptionScheduleCreateParamsPhaseItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_schedule_modify_params.py b/stripe/params/_subscription_schedule_modify_params.py index e47484ff5..8b2ae3899 100644 --- a/stripe/params/_subscription_schedule_modify_params.py +++ b/stripe/params/_subscription_schedule_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -382,7 +383,7 @@ class SubscriptionScheduleModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -561,7 +562,7 @@ class SubscriptionScheduleModifyParamsPhaseItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_schedule_update_params.py b/stripe/params/_subscription_schedule_update_params.py index 4427a0bbf..cae542fe8 100644 --- a/stripe/params/_subscription_schedule_update_params.py +++ b/stripe/params/_subscription_schedule_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -381,7 +382,7 @@ class SubscriptionScheduleUpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -560,7 +561,7 @@ class SubscriptionScheduleUpdateParamsPhaseItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index 5a5bae611..6f81793ab 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -262,7 +263,7 @@ class SubscriptionUpdateParamsAddInvoiceItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ @@ -445,7 +446,7 @@ class SubscriptionUpdateParamsItemPriceData(TypedDict): """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 8a1fa88af..5fb4f0682 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -934,7 +935,7 @@ class SessionCreateParamsLineItemPriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/checkout/_session_modify_params.py b/stripe/params/checkout/_session_modify_params.py index ee3989f1b..b6245252e 100644 --- a/stripe/params/checkout/_session_modify_params.py +++ b/stripe/params/checkout/_session_modify_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -166,7 +167,7 @@ class SessionModifyParamsLineItemPriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/checkout/_session_update_params.py b/stripe/params/checkout/_session_update_params.py index f0ac3ed7d..e03f56c71 100644 --- a/stripe/params/checkout/_session_update_params.py +++ b/stripe/params/checkout/_session_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -165,7 +166,7 @@ class SessionUpdateParamsLineItemPriceData(TypedDict): """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ - unit_amount_decimal: NotRequired[str] + unit_amount_decimal: NotRequired[Decimal] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ diff --git a/stripe/params/climate/_order_create_params.py b/stripe/params/climate/_order_create_params.py index 7f0785799..7ffb35bea 100644 --- a/stripe/params/climate/_order_create_params.py +++ b/stripe/params/climate/_order_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import Dict, List from typing_extensions import NotRequired, TypedDict @@ -26,7 +27,7 @@ class OrderCreateParams(RequestOptions): """ Set of [key-value pairs](https://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`. """ - metric_tons: NotRequired[str] + metric_tons: NotRequired[Decimal] """ Requested number of tons for the order. Either this or `amount` must be specified. """ diff --git a/stripe/params/issuing/_authorization_capture_params.py b/stripe/params/issuing/_authorization_capture_params.py index ceb709ffc..d1370b317 100644 --- a/stripe/params/issuing/_authorization_capture_params.py +++ b/stripe/params/issuing/_authorization_capture_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -133,7 +134,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdown( class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -142,7 +143,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ @@ -151,11 +152,11 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -218,7 +219,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -249,7 +250,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ @@ -268,6 +269,6 @@ class AuthorizationCaptureParamsPurchaseDetailsLodging(TypedDict): class AuthorizationCaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] - quantity: NotRequired[str] + quantity: NotRequired[Decimal] total: NotRequired[int] unit_cost: NotRequired[int] diff --git a/stripe/params/issuing/_authorization_create_params.py b/stripe/params/issuing/_authorization_create_params.py index 17ab73799..4827fe2db 100644 --- a/stripe/params/issuing/_authorization_create_params.py +++ b/stripe/params/issuing/_authorization_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -161,25 +162,25 @@ class AuthorizationCreateParamsFleetReportedBreakdown(TypedDict): class AuthorizationCreateParamsFleetReportedBreakdownFuel(TypedDict): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class AuthorizationCreateParamsFleetReportedBreakdownNonFuel(TypedDict): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class AuthorizationCreateParamsFleetReportedBreakdownTax(TypedDict): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -190,7 +191,7 @@ class AuthorizationCreateParamsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -221,7 +222,7 @@ class AuthorizationCreateParamsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ diff --git a/stripe/params/issuing/_authorization_finalize_amount_params.py b/stripe/params/issuing/_authorization_finalize_amount_params.py index 64b9053a9..3ffab70e7 100644 --- a/stripe/params/issuing/_authorization_finalize_amount_params.py +++ b/stripe/params/issuing/_authorization_finalize_amount_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -98,7 +99,7 @@ class AuthorizationFinalizeAmountParamsFleetReportedBreakdown(TypedDict): class AuthorizationFinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -107,18 +108,18 @@ class AuthorizationFinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): class AuthorizationFinalizeAmountParamsFleetReportedBreakdownNonFuel( TypedDict ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class AuthorizationFinalizeAmountParamsFleetReportedBreakdownTax(TypedDict): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -129,7 +130,7 @@ class AuthorizationFinalizeAmountParamsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -160,7 +161,7 @@ class AuthorizationFinalizeAmountParamsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ diff --git a/stripe/params/issuing/_transaction_create_force_capture_params.py b/stripe/params/issuing/_transaction_create_force_capture_params.py index c71bcfca7..1f5356492 100644 --- a/stripe/params/issuing/_transaction_create_force_capture_params.py +++ b/stripe/params/issuing/_transaction_create_force_capture_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -487,7 +488,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown( class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -496,7 +497,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFu class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ @@ -505,11 +506,11 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNo class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -574,7 +575,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -605,7 +606,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ @@ -624,6 +625,6 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): class TransactionCreateForceCaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] - quantity: NotRequired[str] + quantity: NotRequired[Decimal] total: NotRequired[int] unit_cost: NotRequired[int] diff --git a/stripe/params/issuing/_transaction_create_unlinked_refund_params.py b/stripe/params/issuing/_transaction_create_unlinked_refund_params.py index d8d6ef226..e2685327b 100644 --- a/stripe/params/issuing/_transaction_create_unlinked_refund_params.py +++ b/stripe/params/issuing/_transaction_create_unlinked_refund_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._request_options import RequestOptions from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -489,7 +490,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -498,7 +499,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ @@ -507,11 +508,11 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -578,7 +579,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -609,7 +610,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ @@ -628,6 +629,6 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): class TransactionCreateUnlinkedRefundParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] - quantity: NotRequired[str] + quantity: NotRequired[Decimal] total: NotRequired[int] unit_cost: NotRequired[int] diff --git a/stripe/params/test_helpers/issuing/_authorization_capture_params.py b/stripe/params/test_helpers/issuing/_authorization_capture_params.py index 8902e15aa..6cc4c1fb7 100644 --- a/stripe/params/test_helpers/issuing/_authorization_capture_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_capture_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -132,7 +133,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdown( class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -141,7 +142,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ @@ -150,11 +151,11 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -217,7 +218,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -248,7 +249,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ @@ -267,6 +268,6 @@ class AuthorizationCaptureParamsPurchaseDetailsLodging(TypedDict): class AuthorizationCaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] - quantity: NotRequired[str] + quantity: NotRequired[Decimal] total: NotRequired[int] unit_cost: NotRequired[int] diff --git a/stripe/params/test_helpers/issuing/_authorization_create_params.py b/stripe/params/test_helpers/issuing/_authorization_create_params.py index 2d9f677ab..cbfd40bfc 100644 --- a/stripe/params/test_helpers/issuing/_authorization_create_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -160,25 +161,25 @@ class AuthorizationCreateParamsFleetReportedBreakdown(TypedDict): class AuthorizationCreateParamsFleetReportedBreakdownFuel(TypedDict): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class AuthorizationCreateParamsFleetReportedBreakdownNonFuel(TypedDict): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class AuthorizationCreateParamsFleetReportedBreakdownTax(TypedDict): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -189,7 +190,7 @@ class AuthorizationCreateParamsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -220,7 +221,7 @@ class AuthorizationCreateParamsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ diff --git a/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py b/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py index af6fd8df6..ead32aab4 100644 --- a/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -97,7 +98,7 @@ class AuthorizationFinalizeAmountParamsFleetReportedBreakdown(TypedDict): class AuthorizationFinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -106,18 +107,18 @@ class AuthorizationFinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): class AuthorizationFinalizeAmountParamsFleetReportedBreakdownNonFuel( TypedDict ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class AuthorizationFinalizeAmountParamsFleetReportedBreakdownTax(TypedDict): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -128,7 +129,7 @@ class AuthorizationFinalizeAmountParamsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -159,7 +160,7 @@ class AuthorizationFinalizeAmountParamsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ diff --git a/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py b/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py index 193a40e0a..95cefa462 100644 --- a/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py +++ b/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -486,7 +487,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown( class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -495,7 +496,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFu class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ @@ -504,11 +505,11 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNo class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -573,7 +574,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -604,7 +605,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ @@ -623,6 +624,6 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): class TransactionCreateForceCaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] - quantity: NotRequired[str] + quantity: NotRequired[Decimal] total: NotRequired[int] unit_cost: NotRequired[int] diff --git a/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py b/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py index 4ab81df69..e5fcb265f 100644 --- a/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py +++ b/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import List from typing_extensions import Literal, NotRequired, TypedDict @@ -488,7 +489,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ @@ -497,7 +498,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): - gross_amount_decimal: NotRequired[str] + gross_amount_decimal: NotRequired[Decimal] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ @@ -506,11 +507,11 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): - local_amount_decimal: NotRequired[str] + local_amount_decimal: NotRequired[Decimal] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ - national_amount_decimal: NotRequired[str] + national_amount_decimal: NotRequired[Decimal] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ @@ -577,7 +578,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ - quantity_decimal: NotRequired[str] + quantity_decimal: NotRequired[Decimal] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ @@ -608,7 +609,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ - unit_cost_decimal: NotRequired[str] + unit_cost_decimal: NotRequired[Decimal] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ @@ -627,6 +628,6 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): class TransactionCreateUnlinkedRefundParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] - quantity: NotRequired[str] + quantity: NotRequired[Decimal] total: NotRequired[int] unit_cost: NotRequired[int] diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index fe9fc9d17..a148cb389 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe.v2._amount import AmountParam from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -2490,7 +2491,7 @@ class AccountCreateParamsIdentityIndividualRelationship(TypedDict): """ Whether the person is an owner of the account's identity. """ - percent_ownership: NotRequired[str] + percent_ownership: NotRequired[Decimal] """ The percent owned by the person of the account's legal entity. """ diff --git a/stripe/params/v2/core/_account_token_create_params.py b/stripe/params/v2/core/_account_token_create_params.py index ad853f64b..735e83b80 100644 --- a/stripe/params/v2/core/_account_token_create_params.py +++ b/stripe/params/v2/core/_account_token_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe.v2._amount import AmountParam from typing import Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict @@ -1176,7 +1177,7 @@ class AccountTokenCreateParamsIdentityIndividualRelationship(TypedDict): """ Whether the person is an owner of the account's identity. """ - percent_ownership: NotRequired[str] + percent_ownership: NotRequired[Decimal] """ The percent owned by the person of the account's legal entity. """ diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 6b7c41e1f..23181924f 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe.v2._amount import AmountParam from typing import Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict @@ -2554,7 +2555,7 @@ class AccountUpdateParamsIdentityIndividualRelationship(TypedDict): """ Whether the person is an owner of the account's identity. """ - percent_ownership: NotRequired[str] + percent_ownership: NotRequired[Decimal] """ The percent owned by the person of the account's legal entity. """ diff --git a/stripe/params/v2/core/accounts/_person_create_params.py b/stripe/params/v2/core/accounts/_person_create_params.py index 2c8bd0cda..a3661bdce 100644 --- a/stripe/params/v2/core/accounts/_person_create_params.py +++ b/stripe/params/v2/core/accounts/_person_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -425,7 +426,7 @@ class PersonCreateParamsRelationship(TypedDict): """ Indicates whether the person is an owner of the associated legal entity. """ - percent_ownership: NotRequired[str] + percent_ownership: NotRequired[Decimal] """ The percentage of ownership the person has in the associated legal entity. """ diff --git a/stripe/params/v2/core/accounts/_person_token_create_params.py b/stripe/params/v2/core/accounts/_person_token_create_params.py index 846020361..bf51ad18e 100644 --- a/stripe/params/v2/core/accounts/_person_token_create_params.py +++ b/stripe/params/v2/core/accounts/_person_token_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict @@ -421,7 +422,7 @@ class PersonTokenCreateParamsRelationship(TypedDict): """ Indicates whether the person is an owner of the associated legal entity. """ - percent_ownership: NotRequired[str] + percent_ownership: NotRequired[Decimal] """ The percentage of ownership the person has in the associated legal entity. """ diff --git a/stripe/params/v2/core/accounts/_person_update_params.py b/stripe/params/v2/core/accounts/_person_update_params.py index a56cca6f8..f398ac6c3 100644 --- a/stripe/params/v2/core/accounts/_person_update_params.py +++ b/stripe/params/v2/core/accounts/_person_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from typing import Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict @@ -425,7 +426,7 @@ class PersonUpdateParamsRelationship(TypedDict): """ Indicates whether the person is an owner of the associated legal entity. """ - percent_ownership: NotRequired[str] + percent_ownership: NotRequired[Decimal] """ The percentage of ownership the person has in the associated legal entity. """ diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 95c0b0352..b916ac050 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._stripe_object import StripeObject from stripe.v2._amount import Amount from typing import ClassVar, Dict, List, Optional @@ -3714,7 +3715,7 @@ class Relationship(StripeObject): """ Whether the individual is an owner of the Account's identity. """ - percent_ownership: Optional[str] + percent_ownership: Optional[Decimal] """ The percentage of the Account's identity that the individual owns. """ @@ -3726,6 +3727,7 @@ class Relationship(StripeObject): """ The individual's title (e.g., CEO, Support Engineer). """ + _field_encodings = {"percent_ownership": "decimal_string"} class ScriptAddresses(StripeObject): class Kana(StripeObject): diff --git a/stripe/v2/core/_account_person.py b/stripe/v2/core/_account_person.py index 05d51e4b2..e15925f4f 100644 --- a/stripe/v2/core/_account_person.py +++ b/stripe/v2/core/_account_person.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from decimal import Decimal from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal @@ -337,7 +338,7 @@ class Relationship(StripeObject): """ Whether the individual is an owner of the Account's identity. """ - percent_ownership: Optional[str] + percent_ownership: Optional[Decimal] """ The percentage of the Account's identity that the individual owns. """ @@ -349,6 +350,7 @@ class Relationship(StripeObject): """ The individual's title (e.g., CEO, Support Engineer). """ + _field_encodings = {"percent_ownership": "decimal_string"} class ScriptAddresses(StripeObject): class Kana(StripeObject): diff --git a/tests/test_decimal_string.py b/tests/test_decimal_string.py index 3aa6ae992..8a750a905 100644 --- a/tests/test_decimal_string.py +++ b/tests/test_decimal_string.py @@ -110,7 +110,9 @@ def test_array_of_decimal_string(self): assert result == {"prices": ["1.0", "2.0", "3.0"]} def test_array_of_objects_with_decimal_string(self): - params = {"items": [{"price": Decimal("1.00")}, {"price": Decimal("2.00")}]} + params = { + "items": [{"price": Decimal("1.00")}, {"price": Decimal("2.00")}] + } schema = {"items": {"price": "decimal_string"}} result = _coerce_v2_params(params, schema) assert result == {"items": [{"price": "1.00"}, {"price": "2.00"}]} @@ -174,7 +176,11 @@ def test_array_of_decimal_string_response(self): key="sk_test", api_mode="V2", ) - assert obj["prices"] == [Decimal("1.0"), Decimal("2.0"), Decimal("3.0")] + assert obj["prices"] == [ + Decimal("1.0"), + Decimal("2.0"), + Decimal("3.0"), + ] assert all(isinstance(v, Decimal) for v in obj["prices"]) def test_unrelated_fields_unchanged_response(self):