Skip to content
Open
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 CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6a1eb046657923602071d7707e99ce8a004a8216
104722335bd36cf4d60f025dc4b0d7150a7c2200
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2261
v2271
14 changes: 14 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ def add_beta_version(
PaymentLinkService as PaymentLinkService,
)
from stripe._payment_location import PaymentLocation as PaymentLocation
from stripe._payment_location_capability import (
PaymentLocationCapability as PaymentLocationCapability,
)
from stripe._payment_location_capability_service import (
PaymentLocationCapabilityService as PaymentLocationCapabilityService,
)
from stripe._payment_location_service import (
PaymentLocationService as PaymentLocationService,
)
Expand Down Expand Up @@ -935,6 +941,14 @@ def add_beta_version(
),
"PaymentLinkService": ("stripe._payment_link_service", False),
"PaymentLocation": ("stripe._payment_location", False),
"PaymentLocationCapability": (
"stripe._payment_location_capability",
False,
),
"PaymentLocationCapabilityService": (
"stripe._payment_location_capability_service",
False,
),
"PaymentLocationService": ("stripe._payment_location_service", False),
"PaymentMethod": ("stripe._payment_method", False),
"PaymentMethodBalance": ("stripe._payment_method_balance", False),
Expand Down
28 changes: 1 addition & 27 deletions stripe/_invoice_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,6 @@ class RateCardRateDetails(StripeObject):
_field_encodings = {"unit_amount_decimal": "decimal_string"}

class ProrationDetails(StripeObject):
class CreditedItems(StripeObject):
class InvoiceLineItems(StripeObject):
invoice: str
"""
The invoice id for the debited line item(s).
"""
invoice_line_items: List[str]
"""
IDs of the debited invoice line item(s) on the invoice that correspond to the credit proration.
"""

invoice_item: Optional[str]
"""
When `type` is `invoice_item`, the invoice item id for the debited invoice item corresponding to this credit proration.
"""
invoice_line_items: Optional[InvoiceLineItems]
type: Literal["invoice_item", "invoice_line_items"]
"""
Whether the credit references a pending invoice item or one or more invoice line items on an invoice.
"""
_inner_class_types = {"invoice_line_items": InvoiceLineItems}

class DiscountAmount(StripeObject):
amount: int
"""
Expand All @@ -256,15 +234,11 @@ class DiscountAmount(StripeObject):
The discount that was applied to get this discount amount.
"""

credited_items: Optional[CreditedItems]
discount_amounts: List[DiscountAmount]
"""
Discount amounts applied when the proration was created.
"""
_inner_class_types = {
"credited_items": CreditedItems,
"discount_amounts": DiscountAmount,
}
_inner_class_types = {"discount_amounts": DiscountAmount}

amount: int
"""
Expand Down
4 changes: 4 additions & 0 deletions stripe/_object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@
),
"payment_link": ("stripe._payment_link", "PaymentLink"),
"payment_location": ("stripe._payment_location", "PaymentLocation"),
"payment_location_capability": (
"stripe._payment_location_capability",
"PaymentLocationCapability",
),
"payment_method": ("stripe._payment_method", "PaymentMethod"),
"payment_method_balance": (
"stripe._payment_method_balance",
Expand Down
4 changes: 4 additions & 0 deletions stripe/_payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4804,6 +4804,10 @@ class TransferData(StripeObject):
"""
Allocated Funds configuration for this PaymentIntent.
"""
allowed_payment_method_types: Optional[List[str]]
"""
The list of payment method types allowed for use with this payment. Stripe automatically returns compatible payment methods from this list in the `payment_method_types` field of the response, based on the other PaymentIntent parameters, such as `currency`, `amount`, and `customer`.
"""
amount: int
"""
Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
Expand Down
128 changes: 128 additions & 0 deletions stripe/_payment_location_capability.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_object import StripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from stripe._util import sanitize_id
from typing import ClassVar, List, Optional, cast
from typing_extensions import Literal, Unpack, TYPE_CHECKING

if TYPE_CHECKING:
from stripe.params._payment_location_capability_modify_params import (
PaymentLocationCapabilityModifyParams,
)


class PaymentLocationCapability(
UpdateableAPIResource["PaymentLocationCapability"],
):
"""
A Payment Location Capability represents a capability for a Stripe account at a Payment Location.
"""

OBJECT_NAME: ClassVar[Literal["payment_location_capability"]] = (
"payment_location_capability"
)

class Requirements(StripeObject):
class Error(StripeObject):
code: Literal["information_missing", "invalid_value_other"]
"""
The code for the type of error.
"""
reason: str
"""
An informative message that indicates the error type and provides additional details about the error.
"""
requirement: str
"""
The specific user onboarding requirement field (in the requirements hash) that needs to be resolved.
"""

currently_due: List[str]
"""
Fields that need to be collected to keep the capability enabled.
"""
disabled_reason: Optional[
Literal[
"account.capability_required",
"pending.onboarding",
"pending.review",
"rejected.other",
"rejected.unsupported_business",
"requirements.fields_needed",
]
]
"""
Description of why the capability is disabled.
"""
errors: List[Error]
"""
Fields that are `currently_due` and need to be collected again because validation or verification failed.
"""
_inner_class_types = {"errors": Error}

account: str
"""
The account for which the capability enables functionality.
"""
capability: Literal["fr_meal_vouchers_conecs_payments"]
"""
The identifier for the capability.
"""
location: str
"""
The payment location for which the capability enables functionality.
"""
object: Literal["payment_location_capability"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
requested: bool
"""
Whether the capability has been requested.
"""
requested_at: Optional[int]
"""
Time at which the capability was requested. Measured in seconds since the Unix epoch.
"""
requirements: Requirements
status: Literal["active", "inactive", "pending", "unrequested"]
"""
The status of the capability.
"""

@classmethod
def modify(
cls, id: str, **params: Unpack["PaymentLocationCapabilityModifyParams"]
) -> "PaymentLocationCapability":
"""
Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter.
"""
url = "%s/%s" % (cls.class_url(), sanitize_id(id))
return cast(
"PaymentLocationCapability",
cls._static_request(
"post",
url,
params=params,
),
)

@classmethod
async def modify_async(
cls, id: str, **params: Unpack["PaymentLocationCapabilityModifyParams"]
) -> "PaymentLocationCapability":
"""
Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter.
"""
url = "%s/%s" % (cls.class_url(), sanitize_id(id))
return cast(
"PaymentLocationCapability",
await cls._static_request_async(
"post",
url,
params=params,
),
)

_inner_class_types = {"requirements": Requirements}
59 changes: 59 additions & 0 deletions stripe/_payment_location_capability_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from typing import Optional, cast
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe._payment_location_capability import PaymentLocationCapability
from stripe._request_options import RequestOptions
from stripe.params._payment_location_capability_update_params import (
PaymentLocationCapabilityUpdateParams,
)


class PaymentLocationCapabilityService(StripeService):
def update(
self,
capability: str,
params: "PaymentLocationCapabilityUpdateParams",
options: Optional["RequestOptions"] = None,
) -> "PaymentLocationCapability":
"""
Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter.
"""
return cast(
"PaymentLocationCapability",
self._request(
"post",
"/v1/payment_location_capabilities/{capability}".format(
capability=sanitize_id(capability),
),
base_address="api",
params=params,
options=options,
),
)

async def update_async(
self,
capability: str,
params: "PaymentLocationCapabilityUpdateParams",
options: Optional["RequestOptions"] = None,
) -> "PaymentLocationCapability":
"""
Updates a specified Payment Location Capability. Request or remove a payment location capability by updating its requested parameter.
"""
return cast(
"PaymentLocationCapability",
await self._request_async(
"post",
"/v1/payment_location_capabilities/{capability}".format(
capability=sanitize_id(capability),
),
base_address="api",
params=params,
options=options,
),
)
16 changes: 16 additions & 0 deletions stripe/_stripe_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
from stripe._payment_intent_service import PaymentIntentService
from stripe._payment_link_service import PaymentLinkService
from stripe._payment_location_service import PaymentLocationService
from stripe._payment_location_capability_service import (
PaymentLocationCapabilityService,
)
from stripe._payment_method_service import PaymentMethodService
from stripe._payment_method_configuration_service import (
PaymentMethodConfigurationService,
Expand Down Expand Up @@ -929,6 +932,19 @@ def payment_links(self) -> "PaymentLinkService":
def payment_locations(self) -> "PaymentLocationService":
return self.v1.payment_locations

@property
@deprecated(
"""
StripeClient.payment_location_capabilities is deprecated, use StripeClient.v1.payment_location_capabilities instead.
All functionality under it has been copied over to StripeClient.v1.payment_location_capabilities.
See [migration guide](https://github.com/stripe/stripe-python/wiki/v1-namespace-in-StripeClient) for more on this and tips on migrating to the new v1 namespace.
""",
)
def payment_location_capabilities(
self,
) -> "PaymentLocationCapabilityService":
return self.v1.payment_location_capabilities

@property
@deprecated(
"""
Expand Down
37 changes: 0 additions & 37 deletions stripe/_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,38 +782,6 @@ class PresentmentDetails(StripeObject):
Currency used for customer payments.
"""

class StatusDetails(StripeObject):
class Paused(StripeObject):
class Subscription(StripeObject):
type: Literal[
"pause_requested",
"system",
"trial_end_without_payment_method",
]
"""
The reason that the subscription was paused.
"""

subscription: Subscription
"""
Information on the `type=subscription` pause.
"""
transitioned_at: int
"""
Unix timestamp in seconds of when the subscription status transitioned to `paused`.
"""
type: Literal["subscription"]
"""
The type of pause.
"""
_inner_class_types = {"subscription": Subscription}

paused: Paused
"""
Indicates when and why the subscription transitioned to the paused status.
"""
_inner_class_types = {"paused": Paused}

class TransferData(StripeObject):
amount_percent: Optional[float]
"""
Expand Down Expand Up @@ -1041,10 +1009,6 @@ class EndBehavior(StripeObject):

If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
"""
status_details: Optional[StatusDetails]
"""
Describes changes to the subscription's status.
"""
test_clock: Optional[ExpandableField["TestClock"]]
"""
ID of the test clock this subscription belongs to.
Expand Down Expand Up @@ -2018,7 +1982,6 @@ async def search_auto_paging_iter_async(
"pending_update": PendingUpdate,
"prebilling": Prebilling,
"presentment_details": PresentmentDetails,
"status_details": StatusDetails,
"transfer_data": TransferData,
"trial_settings": TrialSettings,
}
Loading
Loading