Stripe Request Options Merger (stripe/_request_options.py)

stripe-python · stripe/_request_options.py · python · MIT
payments, integration, lang:python, tag:request, tag:options, tag:merge

Combines client‑wide and per‑call request options, giving precedence to request‑level values such as API key, version, account, retries, and headers.

# Source: https://github.com/stripe/stripe-python | License: MIT | Copyright 2010-2018 Stripe (http://stripe.com)
# Provided via justclaw.it.com; keep this notice with the code.
from stripe._requestor_options import RequestorOptions
from typing import Mapping, Optional, Dict, Tuple, Any
from typing_extensions import NotRequired, TypedDict, TYPE_CHECKING

if TYPE_CHECKING:
    from stripe._stripe_context import StripeContext


class RequestOptions(TypedDict):
    api_key: NotRequired["str|None"]
    stripe_version: NotRequired["str|None"]
    stripe_account: NotRequired["str|None"]
    stripe_context: NotRequired["str | StripeContext | None"]
    max_network_retries: NotRequired["int|None"]
    idempotency_key: NotRequired["str|None"]
    content_type: NotRequired["str|None"]
    headers: N

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key