submitPlay
Description
Submits a lottery play request for a validated cart. This function enforces compliance checks before play is processed.
Function Signature
submitPlay(userId: string, cart: CartData): Promise<PlaySubmissionResult>
Behavior
- Ensures the user is age-verified using verifyAgeIfNeeded(userId).
- Validates the funding source via validateFunding(cart).
- Submits the play only if all preconditions pass.
Sample Output (Success)
{
"status": "submitted",
"playId": "abc123"
}
Sample Output (Failure - Age Verification)
{
"error": "Age verification required"
}
Sample Output (Failure - Invalid Funding)
{
"error": "Invalid funding method"
}
Compliance Note
All Drawn play submissions are subject to strict validation of player eligibility and funding source. Credit card payments are disallowed for lottery, and age must be verified before processing.