@aglyn/plugins-commerce 1.29.1 → 1.29.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.
Files changed (89) hide show
  1. package/package.json +13 -13
  2. package/src/lib/components/console/checkout-tax-blocked-notice.component.d.ts +18 -0
  3. package/src/lib/components/console/checkout-tax-blocked-notice.component.js +67 -0
  4. package/src/lib/components/console/checkout-tax-blocked-notice.component.js.map +1 -0
  5. package/src/lib/components/console/payments-settings-card.component.d.ts +2 -2
  6. package/src/lib/components/console/payments-settings-card.component.js +99 -5
  7. package/src/lib/components/console/payments-settings-card.component.js.map +1 -1
  8. package/src/lib/components/console/product-editor-dialog.component.js +14 -3
  9. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
  10. package/src/lib/components/console/products-hub-card.component.js +51 -14
  11. package/src/lib/components/console/products-hub-card.component.js.map +1 -1
  12. package/src/lib/components/console/stripe-tax-readiness.component.d.ts +45 -0
  13. package/src/lib/components/console/stripe-tax-readiness.component.js +276 -0
  14. package/src/lib/components/console/stripe-tax-readiness.component.js.map +1 -0
  15. package/src/lib/components/console/tax-settings-card.component.js +22 -8
  16. package/src/lib/components/console/tax-settings-card.component.js.map +1 -1
  17. package/src/lib/constants/operator-alerts.d.ts +9 -0
  18. package/src/lib/constants/operator-alerts.js +22 -1
  19. package/src/lib/constants/operator-alerts.js.map +1 -1
  20. package/src/lib/declarations.server.js +11 -0
  21. package/src/lib/declarations.server.js.map +1 -1
  22. package/src/lib/model/commerce-record-routes.d.ts +13 -1
  23. package/src/lib/model/commerce-record-routes.js +22 -2
  24. package/src/lib/model/commerce-record-routes.js.map +1 -1
  25. package/src/lib/model/commerce-tax-readiness.d.ts +79 -0
  26. package/src/lib/model/commerce-tax-readiness.js +99 -0
  27. package/src/lib/model/commerce-tax-readiness.js.map +1 -0
  28. package/src/lib/model/commerce.d.ts +7 -0
  29. package/src/lib/model/commerce.js +17 -4
  30. package/src/lib/model/commerce.js.map +1 -1
  31. package/src/lib/model/payments-setup-status.d.ts +68 -0
  32. package/src/lib/model/payments-setup-status.js +103 -0
  33. package/src/lib/model/payments-setup-status.js.map +1 -0
  34. package/src/lib/plan-entitlements.d.ts +2 -2
  35. package/src/lib/plan-entitlements.js +4 -12
  36. package/src/lib/plan-entitlements.js.map +1 -1
  37. package/src/lib/server/cart-checkout.js +3 -0
  38. package/src/lib/server/cart-checkout.js.map +1 -1
  39. package/src/lib/server/checkout-tax-refusal.d.ts +51 -0
  40. package/src/lib/server/checkout-tax-refusal.js +133 -0
  41. package/src/lib/server/checkout-tax-refusal.js.map +1 -0
  42. package/src/lib/server/checkout.d.ts +2 -1
  43. package/src/lib/server/checkout.js +7 -2
  44. package/src/lib/server/checkout.js.map +1 -1
  45. package/src/lib/server/connect-prefill.d.ts +65 -0
  46. package/src/lib/server/connect-prefill.js +85 -0
  47. package/src/lib/server/connect-prefill.js.map +1 -0
  48. package/src/lib/server/connect.d.ts +4 -2
  49. package/src/lib/server/connect.js +117 -37
  50. package/src/lib/server/connect.js.map +1 -1
  51. package/src/lib/server/draft-order.js +4 -2
  52. package/src/lib/server/draft-order.js.map +1 -1
  53. package/src/lib/server/pos-order.js +1 -1
  54. package/src/lib/server/pos-order.js.map +1 -1
  55. package/src/lib/server/product-writer.d.ts +27 -0
  56. package/src/lib/server/product-writer.js +174 -4
  57. package/src/lib/server/product-writer.js.map +1 -1
  58. package/src/lib/server/quote-pay.d.ts +6 -0
  59. package/src/lib/server/quote-pay.js +8 -2
  60. package/src/lib/server/quote-pay.js.map +1 -1
  61. package/src/lib/server/seller-stripe-account.d.ts +19 -0
  62. package/src/lib/server/seller-stripe-account.js +40 -4
  63. package/src/lib/server/seller-stripe-account.js.map +1 -1
  64. package/src/lib/server/site-page-resolver.d.ts +11 -5
  65. package/src/lib/server/site-page-resolver.js +102 -19
  66. package/src/lib/server/site-page-resolver.js.map +1 -1
  67. package/src/lib/server/site-search.d.ts +43 -0
  68. package/src/lib/server/site-search.js +124 -0
  69. package/src/lib/server/site-search.js.map +1 -0
  70. package/src/lib/server/tax-readiness.d.ts +56 -0
  71. package/src/lib/server/tax-readiness.js +169 -0
  72. package/src/lib/server/tax-readiness.js.map +1 -0
  73. package/src/lib/server.js +10 -2
  74. package/src/lib/server.js.map +1 -1
  75. package/src/lib/transfer/product-image-copy.server.d.ts +77 -0
  76. package/src/lib/transfer/product-image-copy.server.js +307 -0
  77. package/src/lib/transfer/product-image-copy.server.js.map +1 -0
  78. package/src/lib/transfer/product-images.d.ts +62 -0
  79. package/src/lib/transfer/product-images.js +143 -0
  80. package/src/lib/transfer/product-images.js.map +1 -0
  81. package/src/lib/transfer/product-sources.d.ts +92 -0
  82. package/src/lib/transfer/product-sources.js +519 -0
  83. package/src/lib/transfer/product-sources.js.map +1 -0
  84. package/src/lib/transfer/product-transfer.d.ts +26 -1
  85. package/src/lib/transfer/product-transfer.js +283 -11
  86. package/src/lib/transfer/product-transfer.js.map +1 -1
  87. package/src/lib/transfer/products.server.d.ts +29 -3
  88. package/src/lib/transfer/products.server.js +289 -13
  89. package/src/lib/transfer/products.server.js.map +1 -1
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * WHAT THE PAYMENTS CARD SAYS ABOUT STRIPE SETUP (AGL-4245), from the owner's
18
+ * profile as the connect route and `account.updated` keep it
19
+ * (`merchantRequirementsSummary`). Pure, so the words are tested apart from
20
+ * the card.
21
+ */ /**
22
+ * The query parameter Stripe's onboarding links come back with, on the
23
+ * Payments section: `done` when the owner finished or left the form,
24
+ * `refresh` when the link had expired or was already opened.
25
+ */ export const CONNECT_RETURN_PARAM = 'connect';
26
+ /** How long a `refresh` return counts as "already continued once", so an expired link never loops. */ export const CONNECT_REFRESH_GUARD_MS = 2 * 60 * 1000;
27
+ const count = (value)=>{
28
+ const n = Number(value);
29
+ return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0;
30
+ };
31
+ /** A deadline as people read it: `March 4, 2027`. */ export function paymentsDeadlineText(ms, locale) {
32
+ return new Date(ms).toLocaleDateString(locale, {
33
+ month: 'long',
34
+ day: 'numeric',
35
+ year: 'numeric'
36
+ });
37
+ }
38
+ /**
39
+ * The standing notice when Stripe needs more from an owner who has already
40
+ * been through its form once, or null when nothing is due.
41
+ *
42
+ * "To keep taking payments" when card payments are already off, else "to
43
+ * keep payouts running": Stripe does not say ahead of time which of the two
44
+ * a missed deadline stops, so the notice names the one that is already
45
+ * affected, or payouts while payments still work.
46
+ */ export function paymentsRequirementsNotice(profile, options = {}) {
47
+ var _options_now;
48
+ if (!(profile == null ? void 0 : profile.stripeAccountId) || profile.stripeDetailsSubmitted !== true) return null;
49
+ const due = count(profile.stripeRequirementsDueCount);
50
+ const pastDue = count(profile.stripeRequirementsPastDueCount);
51
+ if (!due && !pastDue) return null;
52
+ const now = (_options_now = options.now) != null ? _options_now : Date.now();
53
+ const deadline = Number(profile.stripeRequirementsDeadlineMs);
54
+ const by = !pastDue && Number.isFinite(deadline) && deadline > now ? ` by ${paymentsDeadlineText(deadline, options.locale)}` : '';
55
+ const what = profile.stripeChargesEnabled === true ? 'keep payouts running' : 'keep taking payments';
56
+ return {
57
+ severity: pastDue ? 'error' : 'warning',
58
+ text: `Stripe needs more details${by} to ${what}.`,
59
+ continueSetup: true
60
+ };
61
+ }
62
+ /**
63
+ * The result shown on the Payments section after Stripe sends the owner back
64
+ * (`?connect=done`), read from the live profile, so it changes by itself when
65
+ * Stripe's update lands.
66
+ */ export function paymentsReturnResult(profile, ready) {
67
+ const due = count(profile == null ? void 0 : profile.stripeRequirementsDueCount) + count(profile == null ? void 0 : profile.stripeRequirementsPastDueCount);
68
+ if (ready && (profile == null ? void 0 : profile.stripePayoutsEnabled) !== false && !due) {
69
+ return {
70
+ severity: 'success',
71
+ text: 'Payments are set up. Your store is ready to take payments.',
72
+ continueSetup: false
73
+ };
74
+ }
75
+ if (ready && (profile == null ? void 0 : profile.stripePayoutsEnabled) === false && !due) {
76
+ return {
77
+ severity: 'info',
78
+ text: 'Your store can take payments. Stripe is still checking your details ' + 'before it sends payouts, and this updates by itself when it is done.',
79
+ continueSetup: false
80
+ };
81
+ }
82
+ if (ready) {
83
+ return {
84
+ severity: 'warning',
85
+ text: 'Your store can take payments, and Stripe still needs a few more details.',
86
+ continueSetup: true
87
+ };
88
+ }
89
+ if ((profile == null ? void 0 : profile.stripeDetailsSubmitted) === true && !due) {
90
+ return {
91
+ severity: 'info',
92
+ text: 'Stripe is checking your details. This updates by itself when it is ' + 'done, and there is nothing more you need to do right now.',
93
+ continueSetup: false
94
+ };
95
+ }
96
+ return {
97
+ severity: 'warning',
98
+ text: 'Stripe still needs a few details before your store can take payments.',
99
+ continueSetup: true
100
+ };
101
+ }
102
+
103
+ //# sourceMappingURL=payments-setup-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/payments-setup-status.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * WHAT THE PAYMENTS CARD SAYS ABOUT STRIPE SETUP (AGL-4245), from the owner's\n * profile as the connect route and `account.updated` keep it\n * (`merchantRequirementsSummary`). Pure, so the words are tested apart from\n * the card.\n */\n\n/**\n * The query parameter Stripe's onboarding links come back with, on the\n * Payments section: `done` when the owner finished or left the form,\n * `refresh` when the link had expired or was already opened.\n */\nexport const CONNECT_RETURN_PARAM = 'connect'\n\n/** How long a `refresh` return counts as \"already continued once\", so an expired link never loops. */\nexport const CONNECT_REFRESH_GUARD_MS = 2 * 60 * 1000\n\n/** The profile fields read here. Every one may be absent on an older profile. */\nexport interface PaymentsSetupProfile {\n stripeAccountId?: unknown\n stripeChargesEnabled?: unknown\n stripePayoutsEnabled?: unknown\n stripeDetailsSubmitted?: unknown\n stripeRequirementsDueCount?: unknown\n stripeRequirementsPastDueCount?: unknown\n stripeRequirementsDeadlineMs?: unknown\n}\n\n/** A notice the card shows, with whether it offers \"Continue setup\". */\nexport interface PaymentsSetupNotice {\n severity: 'success' | 'info' | 'warning' | 'error'\n text: string\n /** The notice names something only Stripe's form can fix. */\n continueSetup: boolean\n}\n\nconst count = (value: unknown): number => {\n const n = Number(value)\n return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0\n}\n\n/** A deadline as people read it: `March 4, 2027`. */\nexport function paymentsDeadlineText(ms: number, locale?: string): string {\n return new Date(ms).toLocaleDateString(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n })\n}\n\n/**\n * The standing notice when Stripe needs more from an owner who has already\n * been through its form once, or null when nothing is due.\n *\n * \"To keep taking payments\" when card payments are already off, else \"to\n * keep payouts running\": Stripe does not say ahead of time which of the two\n * a missed deadline stops, so the notice names the one that is already\n * affected, or payouts while payments still work.\n */\nexport function paymentsRequirementsNotice(\n profile: PaymentsSetupProfile | null | undefined,\n options: { now?: number; locale?: string } = {},\n): PaymentsSetupNotice | null {\n if (!profile?.stripeAccountId || profile.stripeDetailsSubmitted !== true) return null\n const due = count(profile.stripeRequirementsDueCount)\n const pastDue = count(profile.stripeRequirementsPastDueCount)\n if (!due && !pastDue) return null\n const now = options.now ?? Date.now()\n const deadline = Number(profile.stripeRequirementsDeadlineMs)\n const by =\n !pastDue && Number.isFinite(deadline) && deadline > now\n ? ` by ${paymentsDeadlineText(deadline, options.locale)}`\n : ''\n const what =\n profile.stripeChargesEnabled === true ? 'keep payouts running' : 'keep taking payments'\n return {\n severity: pastDue ? 'error' : 'warning',\n text: `Stripe needs more details${by} to ${what}.`,\n continueSetup: true,\n }\n}\n\n/**\n * The result shown on the Payments section after Stripe sends the owner back\n * (`?connect=done`), read from the live profile, so it changes by itself when\n * Stripe's update lands.\n */\nexport function paymentsReturnResult(\n profile: PaymentsSetupProfile | null | undefined,\n ready: boolean,\n): PaymentsSetupNotice {\n const due =\n count(profile?.stripeRequirementsDueCount) + count(profile?.stripeRequirementsPastDueCount)\n if (ready && profile?.stripePayoutsEnabled !== false && !due) {\n return {\n severity: 'success',\n text: 'Payments are set up. Your store is ready to take payments.',\n continueSetup: false,\n }\n }\n if (ready && profile?.stripePayoutsEnabled === false && !due) {\n return {\n severity: 'info',\n text:\n 'Your store can take payments. Stripe is still checking your details ' +\n 'before it sends payouts, and this updates by itself when it is done.',\n continueSetup: false,\n }\n }\n if (ready) {\n return {\n severity: 'warning',\n text: 'Your store can take payments, and Stripe still needs a few more details.',\n continueSetup: true,\n }\n }\n if (profile?.stripeDetailsSubmitted === true && !due) {\n return {\n severity: 'info',\n text:\n 'Stripe is checking your details. This updates by itself when it is ' +\n 'done, and there is nothing more you need to do right now.',\n continueSetup: false,\n }\n }\n return {\n severity: 'warning',\n text: 'Stripe still needs a few details before your store can take payments.',\n continueSetup: true,\n }\n}\n"],"names":["CONNECT_RETURN_PARAM","CONNECT_REFRESH_GUARD_MS","count","value","n","Number","isFinite","Math","floor","paymentsDeadlineText","ms","locale","Date","toLocaleDateString","month","day","year","paymentsRequirementsNotice","profile","options","stripeAccountId","stripeDetailsSubmitted","due","stripeRequirementsDueCount","pastDue","stripeRequirementsPastDueCount","now","deadline","stripeRequirementsDeadlineMs","by","what","stripeChargesEnabled","severity","text","continueSetup","paymentsReturnResult","ready","stripePayoutsEnabled"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;CAKC,GAED;;;;CAIC,GACD,OAAO,MAAMA,uBAAuB,UAAS;AAE7C,oGAAoG,GACpG,OAAO,MAAMC,2BAA2B,IAAI,KAAK,KAAI;AAqBrD,MAAMC,QAAQ,CAACC;IACb,MAAMC,IAAIC,OAAOF;IACjB,OAAOE,OAAOC,QAAQ,CAACF,MAAMA,IAAI,IAAIG,KAAKC,KAAK,CAACJ,KAAK;AACvD;AAEA,mDAAmD,GACnD,OAAO,SAASK,qBAAqBC,EAAU,EAAEC,MAAe;IAC9D,OAAO,IAAIC,KAAKF,IAAIG,kBAAkB,CAACF,QAAQ;QAC7CG,OAAO;QACPC,KAAK;QACLC,MAAM;IACR;AACF;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASC,2BACdC,OAAgD,EAChDC,UAA6C,CAAC,CAAC;QAMnCA;IAJZ,IAAI,EAACD,2BAAAA,QAASE,eAAe,KAAIF,QAAQG,sBAAsB,KAAK,MAAM,OAAO;IACjF,MAAMC,MAAMpB,MAAMgB,QAAQK,0BAA0B;IACpD,MAAMC,UAAUtB,MAAMgB,QAAQO,8BAA8B;IAC5D,IAAI,CAACH,OAAO,CAACE,SAAS,OAAO;IAC7B,MAAME,OAAMP,eAAAA,QAAQO,GAAG,YAAXP,eAAeP,KAAKc,GAAG;IACnC,MAAMC,WAAWtB,OAAOa,QAAQU,4BAA4B;IAC5D,MAAMC,KACJ,CAACL,WAAWnB,OAAOC,QAAQ,CAACqB,aAAaA,WAAWD,MAChD,CAAC,IAAI,EAAEjB,qBAAqBkB,UAAUR,QAAQR,MAAM,GAAG,GACvD;IACN,MAAMmB,OACJZ,QAAQa,oBAAoB,KAAK,OAAO,yBAAyB;IACnE,OAAO;QACLC,UAAUR,UAAU,UAAU;QAC9BS,MAAM,CAAC,yBAAyB,EAAEJ,GAAG,IAAI,EAAEC,KAAK,CAAC,CAAC;QAClDI,eAAe;IACjB;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASC,qBACdjB,OAAgD,EAChDkB,KAAc;IAEd,MAAMd,MACJpB,MAAMgB,2BAAAA,QAASK,0BAA0B,IAAIrB,MAAMgB,2BAAAA,QAASO,8BAA8B;IAC5F,IAAIW,SAASlB,CAAAA,2BAAAA,QAASmB,oBAAoB,MAAK,SAAS,CAACf,KAAK;QAC5D,OAAO;YACLU,UAAU;YACVC,MAAM;YACNC,eAAe;QACjB;IACF;IACA,IAAIE,SAASlB,CAAAA,2BAAAA,QAASmB,oBAAoB,MAAK,SAAS,CAACf,KAAK;QAC5D,OAAO;YACLU,UAAU;YACVC,MACE,yEACA;YACFC,eAAe;QACjB;IACF;IACA,IAAIE,OAAO;QACT,OAAO;YACLJ,UAAU;YACVC,MAAM;YACNC,eAAe;QACjB;IACF;IACA,IAAIhB,CAAAA,2BAAAA,QAASG,sBAAsB,MAAK,QAAQ,CAACC,KAAK;QACpD,OAAO;YACLU,UAAU;YACVC,MACE,wEACA;YACFC,eAAe;QACjB;IACF;IACA,OAAO;QACLF,UAAU;QACVC,MAAM;QACNC,eAAe;IACjB;AACF"}
@@ -36,7 +36,7 @@ declare module '@aglyn/aglyn/plugin-manager/plugin-entitlement-keys' {
36
36
  *
37
37
  * Recurring billing, paid memberships and gift cards start at Pro since
38
38
  * pricing v4 (2026-11-03, AGL-4126): every Business feature moved into Pro at
39
- * no charge, and the 3% digital fee is their usage price. `FROM_BUSINESS`
40
- * stays the shape a retired plan reads.
39
+ * no charge, and the digital fee (1% on Pro since 2026-11-24) is their
40
+ * usage price.
41
41
  */
42
42
  export declare function commercePlanEntitlements(): PluginPlanEntitlementsDeclaration;
@@ -15,27 +15,19 @@
15
15
  * limitations under the License.
16
16
  */ // Types only: the manifest generator loads this module on its own to compile
17
17
  // the plan figures, so nothing here may reach a core module at runtime.
18
- import { _ as _extends } from "@swc/helpers/_/_extends";
19
- /** Business and up. */ const FROM_BUSINESS = {
18
+ /** Pro and up. */ const FROM_PRO = {
20
19
  free: false,
21
20
  starter: false,
22
- pro: false,
23
- business: true,
24
- scale: true,
25
- advanced: true,
26
- agency: true,
21
+ pro: true,
27
22
  enterprise: true
28
23
  };
29
- /** Pro and up. */ const FROM_PRO = _extends({}, FROM_BUSINESS, {
30
- pro: true
31
- });
32
24
  /**
33
25
  * Commerce's plan gates, for the manifest generator.
34
26
  *
35
27
  * Recurring billing, paid memberships and gift cards start at Pro since
36
28
  * pricing v4 (2026-11-03, AGL-4126): every Business feature moved into Pro at
37
- * no charge, and the 3% digital fee is their usage price. `FROM_BUSINESS`
38
- * stays the shape a retired plan reads.
29
+ * no charge, and the digital fee (1% on Pro since 2026-11-24) is their
30
+ * usage price.
39
31
  */ export function commercePlanEntitlements() {
40
32
  return {
41
33
  features: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/plan-entitlements.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Types only: the manifest generator loads this module on its own to compile\n// the plan figures, so nothing here may reach a core module at runtime.\nimport type { OrgPlan } from '@aglyn/aglyn/foundation/definitions/org-billing.types'\nimport type { PluginPlanEntitlementsDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-plan-entitlements'\n\n/**\n * COMMERCE'S PLAN GATES (AGL-3080): the storefront features that start above\n * the entry tiers. Compiled into core's `PLAN_ENTITLEMENTS` by the manifest\n * generator (`register.planEntitlements`), so the plan comparison and every\n * gate read the answers they always have.\n */\ndeclare module '@aglyn/aglyn/plugin-manager/plugin-entitlement-keys' {\n interface PluginEntitlementFeatures {\n /** Recurring storefront subscription products (AGL-303). */\n storefrontSubscriptions?: boolean\n /** Gift cards & store credit (AGL-322). */\n giftCards?: boolean\n /** Commerce analytics dashboard (AGL-327). */\n commerceAnalytics?: boolean\n }\n}\n\n/** Business and up. */\nconst FROM_BUSINESS: Readonly<Record<OrgPlan, boolean>> = {\n free: false,\n starter: false,\n pro: false,\n business: true,\n scale: true,\n advanced: true,\n agency: true,\n enterprise: true,\n}\n\n/** Pro and up. */\nconst FROM_PRO: Readonly<Record<OrgPlan, boolean>> = {\n ...FROM_BUSINESS,\n pro: true,\n}\n\n/**\n * Commerce's plan gates, for the manifest generator.\n *\n * Recurring billing, paid memberships and gift cards start at Pro since\n * pricing v4 (2026-11-03, AGL-4126): every Business feature moved into Pro at\n * no charge, and the 3% digital fee is their usage price. `FROM_BUSINESS`\n * stays the shape a retired plan reads.\n */\nexport function commercePlanEntitlements(): PluginPlanEntitlementsDeclaration {\n return {\n features: [\n {\n key: 'storefrontSubscriptions',\n label: 'Storefront subscriptions',\n byPlan: FROM_PRO,\n },\n { key: 'giftCards', label: 'Gift cards', byPlan: FROM_PRO },\n {\n key: 'commerceAnalytics',\n label: 'Commerce analytics',\n byPlan: FROM_PRO,\n },\n ],\n }\n}\n"],"names":["FROM_BUSINESS","free","starter","pro","business","scale","advanced","agency","enterprise","FROM_PRO","commercePlanEntitlements","features","key","label","byPlan"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,6EAA6E;AAC7E,wEAAwE;;AAqBxE,qBAAqB,GACrB,MAAMA,gBAAoD;IACxDC,MAAM;IACNC,SAAS;IACTC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,QAAQ;IACRC,YAAY;AACd;AAEA,gBAAgB,GAChB,MAAMC,WAA+C,aAChDT;IACHG,KAAK;;AAGP;;;;;;;CAOC,GACD,OAAO,SAASO;IACd,OAAO;QACLC,UAAU;YACR;gBACEC,KAAK;gBACLC,OAAO;gBACPC,QAAQL;YACV;YACA;gBAAEG,KAAK;gBAAaC,OAAO;gBAAcC,QAAQL;YAAS;YAC1D;gBACEG,KAAK;gBACLC,OAAO;gBACPC,QAAQL;YACV;SACD;IACH;AACF"}
1
+ {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/plan-entitlements.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Types only: the manifest generator loads this module on its own to compile\n// the plan figures, so nothing here may reach a core module at runtime.\nimport type { OrgPlan } from '@aglyn/aglyn/foundation/definitions/org-billing.types'\nimport type { PluginPlanEntitlementsDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-plan-entitlements'\n\n/**\n * COMMERCE'S PLAN GATES (AGL-3080): the storefront features that start above\n * the entry tiers. Compiled into core's `PLAN_ENTITLEMENTS` by the manifest\n * generator (`register.planEntitlements`), so the plan comparison and every\n * gate read the answers they always have.\n */\ndeclare module '@aglyn/aglyn/plugin-manager/plugin-entitlement-keys' {\n interface PluginEntitlementFeatures {\n /** Recurring storefront subscription products (AGL-303). */\n storefrontSubscriptions?: boolean\n /** Gift cards & store credit (AGL-322). */\n giftCards?: boolean\n /** Commerce analytics dashboard (AGL-327). */\n commerceAnalytics?: boolean\n }\n}\n\n/** Pro and up. */\nconst FROM_PRO: Readonly<Record<OrgPlan, boolean>> = {\n free: false,\n starter: false,\n pro: true,\n enterprise: true,\n}\n\n/**\n * Commerce's plan gates, for the manifest generator.\n *\n * Recurring billing, paid memberships and gift cards start at Pro since\n * pricing v4 (2026-11-03, AGL-4126): every Business feature moved into Pro at\n * no charge, and the digital fee (1% on Pro since 2026-11-24) is their\n * usage price.\n */\nexport function commercePlanEntitlements(): PluginPlanEntitlementsDeclaration {\n return {\n features: [\n {\n key: 'storefrontSubscriptions',\n label: 'Storefront subscriptions',\n byPlan: FROM_PRO,\n },\n { key: 'giftCards', label: 'Gift cards', byPlan: FROM_PRO },\n {\n key: 'commerceAnalytics',\n label: 'Commerce analytics',\n byPlan: FROM_PRO,\n },\n ],\n }\n}\n"],"names":["FROM_PRO","free","starter","pro","enterprise","commercePlanEntitlements","features","key","label","byPlan"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,6EAA6E;AAC7E,wEAAwE;AAqBxE,gBAAgB,GAChB,MAAMA,WAA+C;IACnDC,MAAM;IACNC,SAAS;IACTC,KAAK;IACLC,YAAY;AACd;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,UAAU;YACR;gBACEC,KAAK;gBACLC,OAAO;gBACPC,QAAQT;YACV;YACA;gBAAEO,KAAK;gBAAaC,OAAO;gBAAcC,QAAQT;YAAS;YAC1D;gBACEO,KAAK;gBACLC,OAAO;gBACPC,QAAQT;YACV;SACD;IACH;AACF"}
@@ -16,6 +16,7 @@ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_wi
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */ import { SELLER_STRIPE_TAX_NOT_SET_UP_MESSAGE, sellerStripeTaxActive } from "./seller-stripe-account.js";
19
+ import { tellCheckoutTaxRefusal } from "./checkout-tax-refusal.js";
19
20
  import { randomUUID } from "crypto";
20
21
  import { readSiteReturnHost, siteReturnUrl } from "@aglyn/aglyn/app-utils/site-return-url";
21
22
  import { advertisingRequestFacts, recordAdvertisingOrderConsent } from "@aglyn/aglyn/plugin-manager/plugin-advertising-conversions";
@@ -1157,6 +1158,7 @@ import { boundedCreditCents, checkoutCreditProviderForCode, encodeCheckoutCredit
1157
1158
  await releasePromotionHolds();
1158
1159
  await releaseStock();
1159
1160
  await claim.release();
1161
+ tellCheckoutTaxRefusal(hostId, 'tax-undecided');
1160
1162
  return res.status(409).json({
1161
1163
  error: CommerceModel.STOREFRONT_TAX_UNDECIDED_MESSAGE
1162
1164
  });
@@ -1185,6 +1187,7 @@ import { boundedCreditCents, checkoutCreditProviderForCode, encodeCheckoutCredit
1185
1187
  await releasePromotionHolds();
1186
1188
  await releaseStock();
1187
1189
  await claim.release();
1190
+ tellCheckoutTaxRefusal(hostId, 'stripe-tax-not-active');
1188
1191
  return res.status(409).json({
1189
1192
  error: SELLER_STRIPE_TAX_NOT_SET_UP_MESSAGE
1190
1193
  });