Checks whether a plain-text coupon code is currently valid, active, and not expired or exhausted. Returns null instead of throwing when the code is invalid, so it's safe to call directly from checkout-form validation.
This method never throws for an invalid code; it returns null. It can still throw StripeOperationError for a genuine Stripe-side failure while searching.
validate() returns null for a code that: doesn't exist, has been manually deactivated, has expired (expiresAt in the past), or has hit maxRedemptions. It does not distinguish between these reasons in the return value; if you need to tell the customer why a code failed, use list() to look it up separately and inspect active / expiresAtUtc / timesRedeemed vs maxRedemptions yourself.