docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SingleProductCartValidator

    A cart validator that checks that only one product is in the cart items list.

    Inheritance
    object
    SingleProductCartValidator
    Implements
    ICartValidator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Purchasing
    Assembly: Unity.Purchasing.dll
    Syntax
    public class SingleProductCartValidator : ICartValidator

    Methods

    Validate(ICart)

    Validates that there is exactly one item in the cart.

    Declaration
    public void Validate(ICart cart)
    Parameters
    Type Name Description
    ICart cart

    The cart to be validated.

    Exceptions
    Type Condition
    InvalidCartException

    Thrown if the amount of items in the cart is not 1.

    Implements

    ICartValidator
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)