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 CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6a1eb046657923602071d7707e99ce8a004a8216
2e266cdaf4a7328b80cf9bc2448dfca91811415c
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2261
v2274
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
62 changes: 62 additions & 0 deletions stripe/_payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,62 @@ class PaymentIntent(

OBJECT_NAME: ClassVar[Literal["payment_intent"]] = "payment_intent"

class AdvancedFeatureDetails(StripeObject):
class DecrementalAuthorization(StripeObject):
status: Literal["available", "unavailable"]
"""
Indicates whether the feature is supported.
"""

class IncrementalAuthorization(StripeObject):
status: Literal["available", "unavailable"]
"""
Indicates whether the feature is supported.
"""

class Multicapture(StripeObject):
status: Literal["available", "unavailable"]
"""
Indicates whether the feature is supported.
"""

class Overcapture(StripeObject):
maximum_amount_capturable: Optional[int]
"""
The maximum amount that can be captured.
"""
status: Literal["available", "unavailable"]
"""
Indicates whether overcapture is supported.
"""

class Reauthorization(StripeObject):
status: Literal["available", "unavailable"]
"""
Indicates whether the feature is supported.
"""

capture_before: Optional[int]
"""
Timestamp at which the authorization will expire if not captured.
"""
decremental_authorization: Optional[DecrementalAuthorization]
incremental_authorization: Optional[IncrementalAuthorization]
multicapture: Optional[Multicapture]
overcapture: Optional[Overcapture]
reauthorization: Optional[Reauthorization]
reauthorize_before: Optional[int]
"""
Timestamp at which the reauthorization window closes.
"""
_inner_class_types = {
"decremental_authorization": DecrementalAuthorization,
"incremental_authorization": IncrementalAuthorization,
"multicapture": Multicapture,
"overcapture": Overcapture,
"reauthorization": Reauthorization,
}

class AgentDetails(StripeObject):
name: str
"""
Expand Down Expand Up @@ -4796,6 +4852,7 @@ class TransferData(StripeObject):
The account (if any) that the payment is attributed to for tax reporting, and where funds from the payment are transferred to after payment success.
"""

advanced_feature_details: Optional[AdvancedFeatureDetails]
agent_details: Optional[AgentDetails]
"""
Details about the agent that initiated the creation of this PaymentIntent.
Expand All @@ -4804,6 +4861,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 Expand Up @@ -7135,6 +7196,7 @@ def test_helpers(self):
return self.TestHelpers(self)

_inner_class_types = {
"advanced_feature_details": AdvancedFeatureDetails,
"agent_details": AgentDetails,
"allocated_funds": AllocatedFunds,
"amount_details": AmountDetails,
Expand Down
211 changes: 211 additions & 0 deletions stripe/_payment_location_capability.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._list_object import ListObject
from stripe._listable_api_resource import ListableAPIResource
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_list_params import (
PaymentLocationCapabilityListParams,
)
from stripe.params._payment_location_capability_modify_params import (
PaymentLocationCapabilityModifyParams,
)
from stripe.params._payment_location_capability_retrieve_params import (
PaymentLocationCapabilityRetrieveParams,
)


class PaymentLocationCapability(
ListableAPIResource["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.
"""
livemode: bool
"""
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
"""
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 list(
cls, **params: Unpack["PaymentLocationCapabilityListParams"]
) -> ListObject["PaymentLocationCapability"]:
"""
Returns a list of PaymentLocationCapability objects associated with the location.
"""
result = cls._static_request(
"get",
cls.class_url(),
params=params,
)
if not isinstance(result, ListObject):
raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)

return result

@classmethod
async def list_async(
cls, **params: Unpack["PaymentLocationCapabilityListParams"]
) -> ListObject["PaymentLocationCapability"]:
"""
Returns a list of PaymentLocationCapability objects associated with the location.
"""
result = await cls._static_request_async(
"get",
cls.class_url(),
params=params,
)
if not isinstance(result, ListObject):
raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)

return result

@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,
),
)

@classmethod
def retrieve(
cls,
id: str,
**params: Unpack["PaymentLocationCapabilityRetrieveParams"],
) -> "PaymentLocationCapability":
"""
Retrieves information about the specified Payment Location Capability.
"""
instance = cls(id, **params)
instance.refresh()
return instance

@classmethod
async def retrieve_async(
cls,
id: str,
**params: Unpack["PaymentLocationCapabilityRetrieveParams"],
) -> "PaymentLocationCapability":
"""
Retrieves information about the specified Payment Location Capability.
"""
instance = cls(id, **params)
await instance.refresh_async()
return instance

@classmethod
def class_url(cls):
return "/v1/payment_location_capabilities"

_inner_class_types = {"requirements": Requirements}
Loading
Loading