@wtree/payload-ecommerce-coupon 3.79.0 → 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 +1 -0
- package/dist/browser.js +3 -2
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +3 -2
- package/dist/browser.mjs.map +1 -1
- package/dist/client/hooks.d.ts.map +1 -1
- package/dist/collections/createCouponsCollection.d.ts +1 -1
- package/dist/collections/createCouponsCollection.d.ts.map +1 -1
- package/dist/endpoints/applyCoupon.d.ts.map +1 -1
- package/dist/endpoints/validateCoupon.d.ts.map +1 -1
- package/dist/hooks/recalculateCart.d.ts.map +1 -1
- package/dist/index.js +383 -115
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +383 -115
- package/dist/index.mjs.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities/applyCouponContext.d.ts +25 -0
- package/dist/utilities/applyCouponContext.d.ts.map +1 -0
- package/dist/utilities/calculateValues.d.ts +7 -3
- package/dist/utilities/calculateValues.d.ts.map +1 -1
- package/dist/utilities/couponDebug.d.ts +27 -0
- package/dist/utilities/couponDebug.d.ts.map +1 -0
- package/dist/utilities/ecommerceMoney.d.ts +13 -0
- package/dist/utilities/ecommerceMoney.d.ts.map +1 -0
- package/dist/utilities/relationId.d.ts +11 -0
- package/dist/utilities/relationId.d.ts.map +1 -0
- package/dist/utilities/sanitizePluginConfig.d.ts.map +1 -1
- package/package.json +1 -1
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();
|