CheckoutResult
The outcome of Sponsorkit.open_checkout().
Class in sponsorkit.models.
from sponsorkit import CheckoutResultAlso 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,
) -> NoneInstances 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 = NoneThe 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.