inttegro.checkout

Models, requests, and enums for Inttegro checkout operations.

Import public types from the singular inttegro.checkout namespace. Related request types, response shapes, and string-backed enums are grouped here for discovery.

 1"""Models, requests, and enums for Inttegro checkout operations.
 2
 3Import public types from the singular ``inttegro.checkout`` namespace. Related request types, response shapes, and string-backed enums are grouped here for discovery."""
 4
 5from importlib import import_module
 6from typing import TYPE_CHECKING, Any
 7
 8if TYPE_CHECKING:
 9    from .order_status import OrderStatus as OrderStatus
10    from .payment_status import PaymentStatus as PaymentStatus
11
12
13_EXPORTS: dict[str, tuple[str, str]] = {
14    "OrderStatus": ("inttegro.checkout.order_status", "OrderStatus"),
15    "PaymentStatus": ("inttegro.checkout.payment_status", "PaymentStatus"),
16}
17
18__all__ = [
19    "OrderStatus",
20    "PaymentStatus",
21]
22
23
24def __getattr__(name: str) -> Any:
25    """Load a public resource type on first access."""
26    try:
27        module_name, attribute_name = _EXPORTS[name]
28    except KeyError:
29        raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
30    value = getattr(import_module(module_name), attribute_name)
31    globals()[name] = value
32    return value
class OrderStatus(inttegro._enum_base.WireEnum):
11class OrderStatus(WireEnum):
12    """Current status of the order.
13
14    Members are strings as well as enum values, so they compare naturally
15    with API payloads and serialize to the lowercase wire value shown below.
16
17    API contract schema: ``CheckoutOrderStatus``.
18    """
19    PREPARING = "preparing"
20    """Wire value ``preparing`` (preparing) for current status of the order"""
21    REQUIRES_PAYMENT = "requires_payment"
22    """Wire value ``requires_payment`` (requires payment) for current status of the order"""
23    COMPLETED = "completed"
24    """Wire value ``completed`` (completed) for current status of the order"""
25    CANCELED = "canceled"
26    """Wire value ``canceled`` (canceled) for current status of the order"""
27    EXPIRED = "expired"
28    """Wire value ``expired`` (expired) for current status of the order"""

Current status of the order.

Members are strings as well as enum values, so they compare naturally with API payloads and serialize to the lowercase wire value shown below.

API contract schema: CheckoutOrderStatus.

PREPARING = <OrderStatus.PREPARING: 'preparing'>

Wire value preparing (preparing) for current status of the order

REQUIRES_PAYMENT = <OrderStatus.REQUIRES_PAYMENT: 'requires_payment'>

Wire value requires_payment (requires payment) for current status of the order

COMPLETED = <OrderStatus.COMPLETED: 'completed'>

Wire value completed (completed) for current status of the order

CANCELED = <OrderStatus.CANCELED: 'canceled'>

Wire value canceled (canceled) for current status of the order

EXPIRED = <OrderStatus.EXPIRED: 'expired'>

Wire value expired (expired) for current status of the order

class PaymentStatus(inttegro._enum_base.WireEnum):
11class PaymentStatus(WireEnum):
12    """Payment status.
13
14    Members are strings as well as enum values, so they compare naturally
15    with API payloads and serialize to the lowercase wire value shown below.
16
17    API contract schema: ``CheckoutPaymentStatus``.
18    """
19    REQUIRES_ACTION = "requires_action"
20    """Wire value ``requires_action`` (requires action) for payment status"""
21    PROCESSING = "processing"
22    """Wire value ``processing`` (processing) for payment status"""
23    SUCCEEDED = "succeeded"
24    """Wire value ``succeeded`` (succeeded) for payment status"""
25    FAILED = "failed"
26    """Wire value ``failed`` (failed) for payment status"""
27    CANCELLED = "cancelled"
28    """Wire value ``cancelled`` (cancelled) for payment status"""

Payment status.

Members are strings as well as enum values, so they compare naturally with API payloads and serialize to the lowercase wire value shown below.

API contract schema: CheckoutPaymentStatus.

REQUIRES_ACTION = <PaymentStatus.REQUIRES_ACTION: 'requires_action'>

Wire value requires_action (requires action) for payment status

PROCESSING = <PaymentStatus.PROCESSING: 'processing'>

Wire value processing (processing) for payment status

SUCCEEDED = <PaymentStatus.SUCCEEDED: 'succeeded'>

Wire value succeeded (succeeded) for payment status

FAILED = <PaymentStatus.FAILED: 'failed'>

Wire value failed (failed) for payment status

CANCELLED = <PaymentStatus.CANCELLED: 'cancelled'>

Wire value cancelled (cancelled) for payment status