tempest_fastapi_sdk.integrations.payment.stripe¶
Stripe, da chave de API ao webhook verificado.
StripeClient
¶
StripeClient(client: HTTPClient)
Typed entry point for the Stripe resources a payments flow needs.
Build it with an :class:HTTPClient from
:func:~tempest_fastapi_sdk.integrations.payment.stripe.stripe_http_client,
so retries, the circuit breaker and the pinned Stripe-Version come
from one place and tests can inject an httpx.MockTransport.
Attributes:
| Name | Type | Description |
|---|---|---|
customers |
StripeResource[StripeCustomer]
|
|
payment_intents |
StripeResource[StripePaymentIntent]
|
|
refunds |
StripeResource[StripeRefund]
|
|
products |
StripeResource[StripeProduct]
|
|
prices |
StripeResource[StripePrice]
|
|
subscriptions |
StripeResource[StripeSubscription]
|
|
invoices |
StripeResource[StripeInvoice]
|
|
checkout_sessions |
StripeResource[StripeCheckoutSession]
|
|
events |
StripeResource[StripeEventObject]
|
|
Initialize the client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
HTTPClient
|
Configured transport. The caller owns its lifecycle, timeout, retry policy and auth headers. |
required |
request
async
¶
request(
method: str,
path: str,
*,
params: Mapping[str, Any] | None = None,
data: Mapping[str, Any] | None = None,
idempotency_key: str | None = None,
expected_object: str | None = None,
) -> dict[str, Any]
Perform one Stripe call and return the decoded body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
HTTP method. |
required |
path
|
str
|
Path starting with |
required |
params
|
Mapping[str, Any] | None
|
Query parameters. Nested
values are bracket-flattened the same way bodies are, so
|
None
|
data
|
Mapping[str, Any] | None
|
Request body, form-encoded. |
None
|
idempotency_key
|
str | None
|
Value for the
|
None
|
expected_object
|
str | None
|
The |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: The decoded JSON body. |
Raises:
| Type | Description |
|---|---|
StripeError
|
On any non-2xx response. |
StripeObjectMismatchError
|
When |
Writes carry an idempotency key by default. Stripe replays the
original response for a repeated key within 24 hours, which is what
makes the SDK's own retry policy safe here: without it, a timeout
on POST /v1/payment_intents followed by a retry can create two
payments.
StripeResource
¶
StripeResource(
client: StripeClient,
path: str,
model: type[ResourceT],
*,
object_type: str | None = None,
)
Bases: Generic[ResourceT]
The five calls Stripe gives every resource, typed to one model.
Generic parameters
ResourceT: The model this resource returns.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path segment under |
model |
type[ResourceT]
|
The model responses validate into. |
object_type |
str | None
|
The |
The parametrized page model (StripeList[model]) is built once in
the constructor: subscripting a generic Pydantic model creates a new
class each time, so doing it per call would rebuild a model on every
listing.
Initialize the resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
StripeClient
|
The owning client. |
required |
path
|
str
|
Path segment under |
required |
model
|
type[ResourceT]
|
Model for responses. |
required |
object_type
|
str | None
|
The |
None
|
create
async
¶
Create the resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Mapping[str, Any]
|
The request body, nested freely —
|
required |
idempotency_key
|
str | None
|
Key Stripe uses to collapse a
retry onto the first attempt. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ResourceT |
ResourceT
|
The created object. |
Raises:
| Type | Description |
|---|---|
StripeObjectMismatchError
|
When the body's |
StripeError
|
When Stripe rejects the request. |
retrieve
async
¶
Read one object by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_id
|
str
|
The object id. |
required |
params
|
Mapping[str, Any] | None
|
Query parameters —
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ResourceT |
ResourceT
|
The object. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
StripeObjectMismatchError
|
When the body's |
StripeError
|
When Stripe rejects the request, including the
|
update
async
¶
update(
resource_id: str, params: Mapping[str, Any], *, idempotency_key: str | None = None
) -> ResourceT
Update one object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_id
|
str
|
The object id. |
required |
params
|
Mapping[str, Any]
|
Fields to change. |
required |
idempotency_key
|
str | None
|
See :meth: |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ResourceT |
ResourceT
|
The updated object. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
StripeObjectMismatchError
|
When the body's |
StripeError
|
When Stripe rejects the request. |
delete
async
¶
delete(resource_id: str) -> StripeDeleted
Delete one object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_id
|
str
|
The object id. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
StripeDeleted |
StripeDeleted
|
The id and the tombstone flag. |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
StripeObjectMismatchError
|
When the body's |
StripeError
|
When Stripe rejects the request. |
list
async
¶
list(params: Mapping[str, Any] | None = None) -> StripeList[ResourceT]
Read one page of objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Mapping[str, Any] | None
|
Query parameters —
|
None
|
Returns:
| Type | Description |
|---|---|
StripeList[ResourceT]
|
StripeList[ResourceT]: The page, with |
StripeList[ResourceT]
|
whether to ask again. |
Raises:
| Type | Description |
|---|---|
StripeError
|
When Stripe rejects the request. |
auto_paginate
async
¶
auto_paginate(
params: Mapping[str, Any] | None = None, *, page_size: int = 100
) -> AsyncIterator[ResourceT]
Walk every page, yielding objects one at a time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
Mapping[str, Any] | None
|
Filters applied to every page. |
None
|
page_size
|
int
|
Objects per request. Stripe caps this at 100. |
100
|
Yields:
| Name | Type | Description |
|---|---|---|
ResourceT |
AsyncIterator[ResourceT]
|
Each object, newest first, across every page. |
Raises:
| Type | Description |
|---|---|
StripeError
|
When Stripe rejects any of the page requests. |
The cursor is the last item's id, not an offset, so pagination stays correct while objects are being created underneath it.
StripeError
¶
StripeError(
message: str,
*,
status_code: int,
error_type: str = "",
code: str = "",
param: str = "",
decline_code: str = "",
request_id: str = "",
payload: Mapping[str, Any] | None = None,
)
Bases: RuntimeError
Raised when Stripe answers with an error payload.
Stripe's error body is a small, stable envelope — error.type,
error.code, error.message, and often error.param naming the
field at fault. Surfacing those beats an HTTPStatusError whose text
the caller has to re-parse.
Attributes:
| Name | Type | Description |
|---|---|---|
status_code |
int
|
The HTTP status. |
error_type |
str
|
Stripe's |
code |
str
|
Stripe's |
param |
str
|
The parameter Stripe blames, when it names one. |
decline_code |
str
|
For a declined card, the issuer's reason. |
request_id |
str
|
Stripe's request id, the one their support asks for. |
payload |
dict[str, Any]
|
The whole decoded error body. |
Initialize the error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Stripe's human-readable message. |
required |
status_code
|
int
|
The HTTP status. |
required |
error_type
|
str
|
Stripe's |
''
|
code
|
str
|
Stripe's |
''
|
param
|
str
|
The offending parameter, when named. |
''
|
decline_code
|
str
|
The issuer's decline reason. |
''
|
request_id
|
str
|
Stripe's request id. |
''
|
payload
|
Mapping[str, Any] | None
|
The decoded body. |
None
|
StripeObjectMismatchError
¶
StripeObjectMismatchError(
*,
expected_object: str,
received_object: str,
status_code: int,
request_id: str = "",
payload: Mapping[str, Any] | None = None,
)
Bases: StripeError
Raised when a 2xx body is not the kind of object the call asked for.
Every Stripe object carries its type in object ("customer",
"payment_intent", "checkout.session"), and a deleted one keeps
the same value next to deleted: true. A body whose object is
missing or names another type did not come from the endpoint the
resource addresses, so validating it into the resource's model would
hand the caller another object's data under the wrong type.
Subclasses :class:StripeError, so except StripeError keeps
catching it. status_code is the (successful) status the body came
with; error_type and code stay empty, since Stripe raised
nothing.
Attributes:
| Name | Type | Description |
|---|---|---|
expected_object |
str
|
The |
received_object |
str
|
The |
Initialize the error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expected_object
|
str
|
The |
required |
received_object
|
str
|
The |
required |
status_code
|
int
|
The HTTP status of the response. |
required |
request_id
|
str
|
Stripe's request id. |
''
|
payload
|
Mapping[str, Any] | None
|
The decoded body. |
None
|
stripe_http_client
¶
stripe_http_client(
api_key: str,
*,
base_url: str = STRIPE_BASE_URL,
api_version: str = STRIPE_API_VERSION,
timeout: float = 30.0,
retry_policy: RetryPolicy | None = None,
extra_headers: Mapping[str, str] | None = None,
transport: AsyncBaseTransport | None = None,
) -> HTTPClient
Build an :class:HTTPClient configured for Stripe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str
|
The secret key ( |
required |
base_url
|
str
|
API host. Override only to point at a proxy or a recorded fixture server. |
STRIPE_BASE_URL
|
api_version
|
str
|
Value for the |
STRIPE_API_VERSION
|
timeout
|
float
|
Total per-request timeout in seconds. Defaults to
|
30.0
|
retry_policy
|
RetryPolicy | None
|
Retry behaviour. |
None
|
extra_headers
|
Mapping[str, str] | None
|
Additional default
headers — |
None
|
transport
|
AsyncBaseTransport | None
|
Transport override.
Pass an |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
HTTPClient |
HTTPClient
|
A client with authentication, the pinned version and |
HTTPClient
|
JSON accept headers already set. |
STRIPE_API_VERSION
module-attribute
¶
The API version this integration is written against.
Taken from info.version of the vendored specification facts
(vendor/stripe-api-facts.yaml), and pinned into the Stripe-Version
header of every request. tests/integrations/payment/stripe asserts the
two agree, so refreshing the facts without revisiting the code fails a
test instead of silently changing response shapes in production.
STRIPE_BASE_URL
module-attribute
¶
servers[0].url from Stripe's OpenAPI specification, without the slash.
There is no separate sandbox host: test mode is selected by the API key
(sk_test_...), not by the URL.
to_minor_units
¶
Convert a human amount into the integer Stripe charges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
Decimal | int | float | str
|
The amount in major units —
|
required |
currency
|
str
|
ISO-4217 code. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The amount in the currency's smallest unit, half-up rounded. |
Examples:
from_minor_units
¶
Convert the integer Stripe reports back into a human amount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
The amount in the currency's smallest unit, as it appears on a Stripe object. |
required |
currency
|
str
|
ISO-4217 code. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Decimal |
Decimal
|
The amount in major units, exact — never a float, so it |
Decimal
|
can go straight into an invoice or a ledger. |
Examples:
currency_exponent
¶
Return how many decimal places a currency has on Stripe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
currency
|
str
|
ISO-4217 code, in any case ( |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
|
int
|
one, |
format_amount
¶
Render a Stripe amount for a human, without a locale library.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
The amount in the currency's smallest unit. |
required |
currency
|
str
|
ISO-4217 code. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
|
str
|
|
|
str
|
SDK does not know the reader's locale, and a wrong thousands |
|
str
|
separator on an invoice is worse than a plain one. |
ZERO_DECIMAL_CURRENCIES
module-attribute
¶
ZERO_DECIMAL_CURRENCIES: frozenset[str] = frozenset(
{
"bif",
"clp",
"djf",
"gnf",
"jpy",
"kmf",
"krw",
"mga",
"pyg",
"rwf",
"ugx",
"vnd",
"vuv",
"xaf",
"xof",
"xpf",
}
)
Currencies Stripe charges in whole units, with no subunit.
Ported from Stripe's "Zero-decimal currencies" table
(https://docs.stripe.com/currencies#zero-decimal). tests pins the
set, so an upstream change shows up as a failing test rather than as a
hundredfold billing error. Lower-case, because Stripe returns and accepts
currency codes in lower case.
THREE_DECIMAL_CURRENCIES
module-attribute
¶
Currencies with three decimal places rather than two.
Ported from Stripe's "Three-decimal currencies" table. Stripe requires the amount to be a multiple of 10 for these — the API rounds to the nearest ten itself, but building the value correctly here keeps the rounding visible to the caller instead of surprising them on the invoice.
verify_signature
¶
verify_signature(
body: bytes,
header: str,
secret: str,
*,
tolerance_seconds: int = DEFAULT_TOLERANCE_SECONDS,
now: float | None = None,
) -> bool
Check a Stripe delivery against the endpoint's signing secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
bytes
|
The raw request body, exactly as received. Any re-serialization changes the bytes and breaks the signature. |
required |
header
|
str
|
The |
required |
secret
|
str
|
The endpoint signing secret ( |
required |
tolerance_seconds
|
int
|
Reject deliveries whose timestamp is
further than this from |
DEFAULT_TOLERANCE_SECONDS
|
now
|
float | None
|
Current epoch seconds. Injectable so tests pin time instead of sleeping. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
bool
|
the window and at least one |
|
bool
|
constant time. An empty or blank secret always returns |
The HMAC covers f"{t}.{body}", not the body — this is the
documented Stripe scheme and the single most common mistake in a
hand-rolled verification.
sign_payload
¶
Build the header Stripe would send for a body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
bytes
|
The raw body to sign. |
required |
secret
|
str
|
The endpoint signing secret. |
required |
timestamp
|
int
|
Epoch seconds to stamp the delivery with. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A |
Shipped rather than left to each test suite: writing this by hand is
exactly where the f"{t}.{body}" detail gets re-derived wrong, and a
test that signs the wrong thing passes against a verifier that checks
the wrong thing.
parse_event
¶
parse_event(body: bytes) -> StripeWebhookEvent
Decode a verified body into a typed event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
bytes
|
The raw, already-verified body. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
StripeWebhookEvent |
StripeWebhookEvent
|
The parsed delivery. A body that is not JSON |
StripeWebhookEvent
|
yields an event with empty fields rather than raising — it |
|
StripeWebhookEvent
|
verified, so it came from Stripe, and discarding a delivery the |
|
StripeWebhookEvent
|
provider considers sent is worse than handling an empty one. |
parse_signature_header
¶
Split a Stripe-Signature header into timestamp and signatures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
header
|
str
|
The raw header value. |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
tuple[int | None, tuple[str, ...]]: The |
tuple[str, ...]
|
( |
tuple[int | None, tuple[str, ...]]
|
There can be more than one during a secret rotation, and accepting |
tuple[int | None, tuple[str, ...]]
|
any of them is what makes rotation possible without dropping |
tuple[int | None, tuple[str, ...]]
|
deliveries. |
make_stripe_webhook_dependency
¶
make_stripe_webhook_dependency(
secret: str,
*,
tolerance_seconds: int = DEFAULT_TOLERANCE_SECONDS,
error_message: str = "Invalid Stripe webhook signature",
) -> Callable[..., Coroutine[Any, Any, StripeWebhookEvent]]
Build a FastAPI dependency yielding a verified, parsed event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
secret
|
str
|
The endpoint signing secret ( |
required |
tolerance_seconds
|
int
|
Replay window, in seconds. |
DEFAULT_TOLERANCE_SECONDS
|
error_message
|
str
|
Message on the raised
:class: |
'Invalid Stripe webhook signature'
|
Returns:
| Type | Description |
|---|---|
Callable[..., Coroutine[Any, Any, StripeWebhookEvent]]
|
Callable[..., Coroutine[Any, Any, StripeWebhookEvent]]: An async |
Callable[..., Coroutine[Any, Any, StripeWebhookEvent]]
|
dependency returning a :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
When |
UnauthorizedException
|
Raised by the returned dependency when the header is missing, malformed, outside the tolerance window, or signed with another secret. |
An unknown event type does not fail the request: Stripe adds event
types continuously, and a service that 500s on one it has never seen
turns their release into its own outage. The type is kept as
event_type with event left None.
StripeWebhookEvent
dataclass
¶
StripeWebhookEvent(
event_type: str,
event: StripeEvent | None = None,
event_id: str = "",
payload: dict[str, Any] = dict(),
data_object: dict[str, Any] = dict(),
body: bytes = b"",
)
A verified Stripe webhook delivery.
A dataclass rather than a :class:BaseSchema: this is the value a
route receives, not a wire DTO. BaseSchema sets
use_enum_values=True, which would store :attr:event as a bare
str — and then delivery.event is StripeEvent.PAYMENT_INTENT_SUCCEEDED
is silently always false.
Attributes:
| Name | Type | Description |
|---|---|---|
event_type |
str
|
The |
event |
StripeEvent | None
|
The parsed event, or |
event_id |
str
|
Stripe's |
payload |
dict[str, Any]
|
The whole decoded body. |
data_object |
dict[str, Any]
|
|
body |
bytes
|
The raw body, byte-for-byte, for logging or a second verification. |
StripeObject
¶
Bases: BaseModel
Base for every Stripe resource.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The object id ( |
object |
str
|
Stripe's own type discriminator ( |
livemode |
bool
|
Whether the object belongs to live mode. |
metadata |
dict[str, str]
|
The key/value map Stripe stores verbatim. String-to-string, because that is all Stripe keeps. |
StripeCustomer
¶
Bases: StripeObject
A customer.
Attributes:
| Name | Type | Description |
|---|---|---|
email |
str | None
|
Billing email. |
name |
str | None
|
Full name. |
phone |
str | None
|
Phone number. |
description |
str | None
|
Free-form internal description. |
currency |
str | None
|
Default currency for invoices. |
created |
int | None
|
Creation time, epoch seconds. |
StripePaymentIntent
¶
Bases: StripeObject
A payment intent — the object a card charge actually is.
Attributes:
| Name | Type | Description |
|---|---|---|
amount |
int
|
Amount in the currency's smallest unit. Convert with
:func: |
amount_received |
int
|
How much has been captured so far. |
currency |
str
|
Lower-case ISO-4217 code. |
status |
str
|
|
client_secret |
str | None
|
The value the frontend confirms with. Treat it as a credential: it authorizes confirming this payment, so it belongs in the response to its own customer and nowhere else — not in a log line. |
customer |
str | None
|
Customer id, or the expanded object in
|
payment_method |
str | None
|
Payment method id. |
latest_charge |
str | None
|
Charge id, once there is one. |
created |
int | None
|
Creation time, epoch seconds. |
StripeRefund
¶
Bases: StripeObject
A refund.
Attributes:
| Name | Type | Description |
|---|---|---|
amount |
int
|
Refunded amount in the smallest unit. |
currency |
str
|
Lower-case ISO-4217 code. |
status |
str
|
|
reason |
str | None
|
|
payment_intent |
str | None
|
The payment being refunded. |
charge |
str | None
|
The charge being refunded. |
created |
int | None
|
Creation time, epoch seconds. |
StripeProduct
¶
Bases: StripeObject
A product — what is being sold, independent of what it costs.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Display name. |
description |
str | None
|
Product description. |
active |
bool
|
Whether it can be used in new purchases. |
default_price |
str | None
|
Price id, when one is set. |
created |
int | None
|
Creation time, epoch seconds. |
StripePrice
¶
Bases: StripeObject
A price — how much a product costs, and how often.
Attributes:
| Name | Type | Description |
|---|---|---|
product |
str
|
Product id. |
active |
bool
|
Whether the price can be used. |
currency |
str
|
Lower-case ISO-4217 code. |
unit_amount |
int | None
|
Amount in the smallest unit. |
recurring |
dict[str, Any] | None
|
|
nickname |
str | None
|
Internal label. |
created |
int | None
|
Creation time, epoch seconds. |
StripeSubscription
¶
Bases: StripeObject
A subscription.
Attributes:
| Name | Type | Description |
|---|---|---|
customer |
str
|
Customer id. |
status |
str
|
|
currency |
str
|
Lower-case ISO-4217 code. |
cancel_at_period_end |
bool
|
Whether it stops at the end of the current period instead of renewing. |
canceled_at |
int | None
|
When it was canceled, epoch seconds. |
latest_invoice |
str | None
|
Invoice id, when there is one. |
created |
int | None
|
Creation time, epoch seconds. |
items |
dict[str, Any] | None
|
The subscription items list, as Stripe returns it. |
StripeInvoice
¶
Bases: StripeObject
An invoice.
Attributes:
| Name | Type | Description |
|---|---|---|
customer |
str | None
|
Customer id. |
subscription |
str | None
|
Subscription id, for a recurring invoice. |
status |
str
|
|
currency |
str
|
Lower-case ISO-4217 code. |
amount_due |
int
|
Amount still owed, smallest unit. |
amount_paid |
int
|
Amount already paid, smallest unit. |
total |
int
|
Invoice total, smallest unit. |
hosted_invoice_url |
str | None
|
Stripe-hosted payment page. |
created |
int | None
|
Creation time, epoch seconds. |
StripeCheckoutSession
¶
Bases: StripeObject
A Checkout session — the hosted payment page.
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str | None
|
Where to send the customer. |
status |
str
|
|
payment_status |
str
|
|
mode |
str
|
|
amount_total |
int | None
|
Total in the smallest unit. |
currency |
str | None
|
Lower-case ISO-4217 code. |
customer |
str | None
|
Customer id, when one is attached. |
payment_intent |
str | None
|
Payment intent id, in |
subscription |
str | None
|
Subscription id, in |
expires_at |
int | None
|
When the session stops accepting payment. |
StripeEventObject
¶
Bases: StripeObject
An event, as read back from /v1/events.
The webhook path has its own type
(:class:~tempest_fastapi_sdk.integrations.payment.stripe.StripeWebhookEvent),
which also carries the verified raw body. This one is what a poll of
the events endpoint returns.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
The event type, e.g. |
api_version |
str | None
|
The API version the payload is rendered in — not necessarily the one you pinned. |
created |
int | None
|
Creation time, epoch seconds. |
data |
dict[str, Any]
|
|
StripeDeleted
¶
Bases: BaseModel
What a delete returns: the id and a tombstone flag.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The deleted object's id. |
object |
str
|
Stripe's type discriminator. |
deleted |
bool
|
Always |
StripeList
¶
Bases: BaseModel, Generic[ResourceT]
One page of a Stripe list response.
Stripe paginates by cursor, not by page number: ask for the next page
with starting_after=<id of the last item>.
:meth:~tempest_fastapi_sdk.integrations.payment.stripe.StripeResource.auto_paginate
does that walk for you.
Attributes:
| Name | Type | Description |
|---|---|---|
object |
str
|
Always |
data |
list[ResourceT]
|
The page's items, newest first. |
has_more |
bool
|
Whether another page exists after this one. |
url |
str
|
The endpoint this page came from. |
StripeEvent
¶
Bases: BaseStrEnum
A Stripe webhook event type.
Members are named after the event string with dots and dashes turned
into underscores, upper-cased. Use :meth:BaseStrEnum.from_value to
parse a delivery, and :meth:BaseStrEnum.has_value to tell a known
event from one Stripe added after this SDK release.