Skip to content

validateFundingSource

Description
This SDK function ensures that lottery purchases are funded using compliant payment methods. Most U.S. states prohibit funding lottery plays with credit cards, requiring ACH or debit instead.


Use Case
This function is called during the play submission process to inspect how each line item in the cart is being paid for and block any non-compliant tender types for lottery items.


Rules - Lottery items must be funded by ACH or debit. - Non-lottery items can use any tender type (credit, EBT, gift card, etc.). - Split tender is supported and encouraged (e.g., ACH for lotto + credit for groceries).


Function Signature

validateFunding(cart: CartData): {
  isValid: boolean;
  lottoTender: string;
  nonLottoTender: string;
}

Behavior - Scans the cart for items marked as "lottery". - Evaluates payment method assigned to those items. - Returns whether the payment method is compliant and what type is in use.


Response (Valid Funding)

{
  "isValid": true,
  "lottoTender": "ACH",
  "nonLottoTender": "credit"
}

Response (Invalid Funding)

{
  "isValid": false,
  "lottoTender": "credit"
}

UI Requirements - Show an error message if user attempts to fund lotto items with credit:

"Lottery purchases must be funded with a debit card or ACH account."

  • If split tender is needed, auto-adjust or prompt:

    "We’ve split your cart: Lotto items will be funded by debit. Your remaining items will use your original payment method."


Compliance Note Drawn enforces payment source eligibility as required by state law. Credit cards are never accepted for lottery orders. ACH or debit must be verified and used at the time of play submission.