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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b3c36f1e05eaa7339c3d0d5e862e76cfff6c6bed
577fcb57736b925392ea563c0284df9002c75ac9
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2080
v2100
4 changes: 4 additions & 0 deletions stripe/_object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@
"stripe.v2.billing._pricing_plan_subscription",
"PricingPlanSubscription",
),
"v2.billing.pricing_plan_subscription_components": (
"stripe.v2.billing._pricing_plan_subscription_components",
"PricingPlanSubscriptionComponents",
),
"v2.billing.pricing_plan_version": (
"stripe.v2.billing._pricing_plan_version",
"PricingPlanVersion",
Expand Down
6 changes: 5 additions & 1 deletion stripe/billing/_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from stripe._stripe_object import StripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from stripe._util import class_method_variant, sanitize_id
from typing import ClassVar, Optional, cast, overload
from typing import ClassVar, List, Optional, cast, overload
from typing_extensions import Literal, Unpack, TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -77,6 +77,10 @@ class ValueSettings(StripeObject):
"""
customer_mapping: CustomerMapping
default_aggregation: DefaultAggregation
dimension_payload_keys: Optional[List[str]]
"""
Set of keys that will be used to group meter events by.
"""
display_name: str
"""
The meter's name.
Expand Down
6 changes: 5 additions & 1 deletion stripe/billing/_meter_event_summary.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_object import StripeObject
from typing import ClassVar
from typing import ClassVar, Dict, Optional
from typing_extensions import Literal


Expand All @@ -20,6 +20,10 @@ class MeterEventSummary(StripeObject):
"""
Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`.
"""
dimensions: Optional[Dict[str, str]]
"""
Key-value pairs of dimension values for event summaries with grouping on dimensions.
"""
end_time: int
"""
End timestamp for this event summary (exclusive). Must be aligned with minute boundaries.
Expand Down
235 changes: 233 additions & 2 deletions stripe/delegated_checkout/_requested_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from stripe._stripe_object import StripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from stripe._util import class_method_variant, sanitize_id
from typing import ClassVar, Optional, cast, overload
from typing import ClassVar, Dict, List, Optional, cast, overload
from typing_extensions import Literal, Unpack, TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -38,8 +38,188 @@ class RequestedSession(
)

class FulfillmentDetails(StripeObject):
class Address(StripeObject):
city: Optional[str]
"""
City, district, suburb, town, or village.
"""
country: Optional[str]
"""
Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
"""
line1: Optional[str]
"""
Address line 1, such as the street, PO Box, or company name.
"""
line2: Optional[str]
"""
Address line 2, such as the apartment, suite, unit, or building.
"""
postal_code: Optional[str]
"""
ZIP or postal code.
"""
state: Optional[str]
"""
State, county, province, or region.
"""

class FulfillmentOption(StripeObject):
class Shipping(StripeObject):
class ShippingOption(StripeObject):
description: Optional[str]
"""
The description of the shipping option.
"""
display_name: str
"""
The display name of the shipping option.
"""
earliest_delivery_time: Optional[int]
"""
The earliest delivery time of the shipping option.
"""
key: str
"""
The key of the shipping option.
"""
latest_delivery_time: Optional[int]
"""
The latest delivery time of the shipping option.
"""
shipping_amount: int
"""
The shipping amount of the shipping option.
"""

shipping_options: Optional[List[ShippingOption]]
"""
The shipping options.
"""
_inner_class_types = {"shipping_options": ShippingOption}

shipping: Optional[Shipping]
"""
The shipping option.
"""
type: str
"""
The type of the fulfillment option.
"""
_inner_class_types = {"shipping": Shipping}

class SelectedFulfillmentOption(StripeObject):
class Shipping(StripeObject):
shipping_option: Optional[str]
"""
The shipping option.
"""

shipping: Optional[Shipping]
"""
The shipping option.
"""
type: str
"""
The type of the selected fulfillment option.
"""
_inner_class_types = {"shipping": Shipping}

address: Optional[Address]
"""
The fulfillment address.
"""
email: Optional[str]
"""
The email address for the fulfillment details.
"""
fulfillment_options: Optional[List[FulfillmentOption]]
"""
The fulfillment options.
"""
name: Optional[str]
"""
The name for the fulfillment details.
"""
phone: Optional[str]
"""
The phone number for the fulfillment details.
"""
selected_fulfillment_option: Optional[SelectedFulfillmentOption]
"""
The fulfillment option.
"""
_inner_class_types = {
"address": Address,
"fulfillment_options": FulfillmentOption,
"selected_fulfillment_option": SelectedFulfillmentOption,
}

class LineItemDetail(StripeObject):
description: Optional[str]
"""
The description of the line item.
"""
images: Optional[List[str]]
"""
The images of the line item.
"""
key: str
"""
The key of the line item.
"""
name: str
"""
The name of the line item.
"""
quantity: int
"""
The quantity of the line item.
"""
sku_id: str
"""
The SKU ID of the line item.
"""
unit_amount: int
"""
The unit amount of the line item.
"""

class OrderDetails(StripeObject):
order_status_url: Optional[str]
"""
The URL to the order status.
"""

class SellerDetails(StripeObject):
pass

class TotalDetails(StripeObject):
amount_discount: Optional[int]
"""
The amount discount of the total details.
"""
amount_fulfillment: Optional[int]
"""
The amount fulfillment of the total details.
"""
amount_tax: Optional[int]
"""
The amount tax of the total details.
"""

amount_subtotal: int
"""
The subtotal amount of the requested session.
"""
amount_total: int
"""
The total amount of the requested session.
"""
created_at: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
currency: str
"""
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Expand All @@ -48,19 +228,64 @@ class FulfillmentDetails(StripeObject):
"""
The customer for this requested session.
"""
expires_at: int
"""
Time at which the requested session expires. Measured in seconds since the Unix epoch.
"""
fulfillment_details: Optional[FulfillmentDetails]
"""
The details of the fulfillment.
"""
id: str
"""
Unique identifier for the object.
"""
line_item_details: List[LineItemDetail]
"""
The line items to be purchased.
"""
livemode: bool
"""
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
"""
metadata: Optional[Dict[str, str]]
"""
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
"""
object: Literal["delegated_checkout.requested_session"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
order_details: Optional[OrderDetails]
"""
The details of the order.
"""
payment_method: Optional[str]
"""
The payment method used for the requested session.
"""
seller_details: SellerDetails
setup_future_usage: Optional[Literal["on_session"]]
"""
Whether or not the payment method should be saved for future use.
"""
shared_metadata: Optional[Dict[str, str]]
"""
The metadata shared with the seller.
"""
shared_payment_issued_token: Optional[str]
"""
The SPT used for payment.
"""
status: Literal["completed", "expired", "open"]
"""
The status of the requested session.
"""
total_details: TotalDetails
updated_at: int
"""
Time at which the object was last updated. Measured in seconds since the Unix epoch.
"""

@classmethod
def _cls_confirm(
Expand Down Expand Up @@ -382,4 +607,10 @@ async def retrieve_async(
await instance.refresh_async()
return instance

_inner_class_types = {"fulfillment_details": FulfillmentDetails}
_inner_class_types = {
"fulfillment_details": FulfillmentDetails,
"line_item_details": LineItemDetail,
"order_details": OrderDetails,
"seller_details": SellerDetails,
"total_details": TotalDetails,
}
4 changes: 2 additions & 2 deletions stripe/delegated_checkout/_requested_session_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def update_async(

def create(
self,
params: Optional["RequestedSessionCreateParams"] = None,
params: "RequestedSessionCreateParams",
options: Optional["RequestOptions"] = None,
) -> "RequestedSession":
"""
Expand All @@ -135,7 +135,7 @@ def create(

async def create_async(
self,
params: Optional["RequestedSessionCreateParams"] = None,
params: "RequestedSessionCreateParams",
options: Optional["RequestOptions"] = None,
) -> "RequestedSession":
"""
Expand Down
Loading