Bazaar.Discount (Bazaar v0.3.0)

Copy Markdown View Source

Business logic helpers for UCP discount capability.

Discounts enable businesses to apply promotional codes and automatic discounts to checkout sessions.

Key Invariants

  • Sum of allocation amounts equals the discount amount
  • Rejected codes appear in codes but not in applied
  • Rejected codes communicated via messages with type "warning"

Summary

Functions

Returns the supported allocation methods.

Returns the supported rejection codes for discount validation.

Returns discount-related total types.

Functions

allocation_methods()

Returns the supported allocation methods.

rejection_codes()

Returns the supported rejection codes for discount validation.

total_types()

Returns discount-related total types.