@wtree/payload-ecommerce-coupon 3.79.1 → 3.79.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -331,6 +331,7 @@ This keeps plugin UI behavior consistent while respecting your product’s style
331
331
  type CouponPluginOptions = {
332
332
  enabled?: boolean
333
333
  enableReferrals?: boolean
334
+ /** @deprecated Ignored at runtime; reserved for future multi-coupon support. */
334
335
  allowStackWithOtherCoupons?: boolean
335
336
  defaultCurrency?: string
336
337
  autoIntegrate?: boolean
package/dist/browser.js CHANGED
@@ -1985,7 +1985,7 @@ function resolveEndpoints(input) {
1985
1985
  * @param endpointConfig - Optional endpoint override config
1986
1986
  */
1987
1987
  async function useCouponCode(options, endpointConfig) {
1988
- const { code, cartID, customerEmail } = options;
1988
+ const { code, cartID, customerEmail, secret } = options;
1989
1989
  if (!code) return {
1990
1990
  success: false,
1991
1991
  message: "Coupon code is required",
@@ -1999,7 +1999,8 @@ async function useCouponCode(options, endpointConfig) {
1999
1999
  body: JSON.stringify({
2000
2000
  code,
2001
2001
  cartID,
2002
- customerEmail
2002
+ customerEmail,
2003
+ ...typeof secret === "string" && secret.trim().length > 0 ? { secret: secret.trim() } : {}
2003
2004
  })
2004
2005
  });
2005
2006
  const data = await response.json();