CheckoutResult

The outcome of Sponsorkit.open_checkout().

On this page

Class in sponsorkit.models.

from sponsorkit import CheckoutResult

Also importable from sponsorkit.models.

@dataclass(frozen=True)
class CheckoutResult:
    ...

The outcome of sponsorkit.Sponsorkit.open_checkout().

status is "contributed" when a new or changed contribution was detected, else "unknown" (timeout or cancellation; the supporter may still have paid).

Constructor#

CheckoutResult(
    status: Literal['contributed', 'unknown'],
    contribution: Contribution | None = None,
) -> None

Instances are immutable; every field below is a constructor parameter.

Fields#

status#

status: Literal['contributed', 'unknown']

contributed when a new or changed contribution was detected, else unknown.

contribution#

contribution: Contribution | None = None

The detected contribution when status is contributed.

Methods#

to_dict()#

def to_dict(self) -> dict[str, Any]

The JSON form: {"status": ...} plus "contribution" when one was detected.