@solvapay/react 2.0.1 → 2.0.2-preview-55843c4d7bb67bbe89bfcdabbbe0e3a679eb2805

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/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-BgyNW-D3.cjs';
3
- export { D as BootstrapPlanLike, E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError } from './shared-BgyNW-D3.cjs';
4
- import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-jmmZYs2K.cjs';
5
- export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } from './index-jmmZYs2K.cjs';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-8vuWAyyz.cjs';
3
+ export { D as BootstrapPlanLike, E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError } from './shared-8vuWAyyz.cjs';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-DrdpB1WK.cjs';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } from './index-DrdpB1WK.cjs';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
8
8
  export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.cjs';
@@ -865,7 +865,7 @@ type UseAutoRechargeReturn = {
865
865
  refresh: (force?: boolean) => Promise<void>;
866
866
  save: (input: SaveAutoRechargeInput) => Promise<SaveAutoRechargeResponse>;
867
867
  disable: () => Promise<{
868
- success: true;
868
+ success: boolean;
869
869
  }>;
870
870
  };
871
871
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-BI78qUom.js';
3
- export { D as BootstrapPlanLike, E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError } from './shared-BI78qUom.js';
4
- import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-DHcgeDBy.js';
5
- export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } from './index-DHcgeDBy.js';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, B as BalanceStatus, q as UseTopupAmountSelectorOptions, r as UseTopupAmountSelectorReturn, s as UsePaymentMethodReturn, t as AutoRechargeConfig, u as SaveAutoRechargeInput, v as SolvaPayTransport, w as PartialSolvaPayCopy, x as PurchaseInfo, y as Product, z as SolvaPayConfig } from './shared-DXOL9qKG.js';
3
+ export { D as BootstrapPlanLike, E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError } from './shared-DXOL9qKG.js';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-DzBmS7A9.js';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UsageSnapshot, x as UseCheckoutFlowOptions, y as UseCheckoutFlowReturn, z as UseUsageReturn, D as configToAutoRechargeInput, E as deriveVariant, F as useCheckoutFlow, G as useCheckoutStepsContext, H as useUsage } from './index-DzBmS7A9.js';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
8
8
  export { AuthAdapter, createAnonymousAuthAdapter, defaultAuthAdapter, getOrCreateAnonymousCustomerRef, resetAnonymousCustomerRef } from './adapters/auth.js';
@@ -865,7 +865,7 @@ type UseAutoRechargeReturn = {
865
865
  refresh: (force?: boolean) => Promise<void>;
866
866
  save: (input: SaveAutoRechargeInput) => Promise<SaveAutoRechargeResponse>;
867
867
  disable: () => Promise<{
868
- success: true;
868
+ success: boolean;
869
869
  }>;
870
870
  };
871
871
 
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  LaunchCustomerPortalButton,
8
8
  UpdatePaymentMethodButton,
9
9
  usePaymentMethod
10
- } from "./chunk-BHG7Z5XV.js";
10
+ } from "./chunk-3H6GEMK7.js";
11
11
  import {
12
12
  ActivationFlow,
13
13
  AutoRecharge,
@@ -23,7 +23,7 @@ import {
23
23
  useCheckoutSteps,
24
24
  useCreditGate,
25
25
  usePaywallResolver
26
- } from "./chunk-ZKFTT5WD.js";
26
+ } from "./chunk-Z2CCCBDY.js";
27
27
  import {
28
28
  AmountPicker,
29
29
  BalanceBadge,
@@ -97,7 +97,7 @@ import {
97
97
  useTopupAmountSelector,
98
98
  useTransport,
99
99
  useUsage
100
- } from "./chunk-GMZU5M6R.js";
100
+ } from "./chunk-JFW3WPVY.js";
101
101
  import {
102
102
  createAnonymousAuthAdapter,
103
103
  defaultAuthAdapter,
@@ -4728,15 +4728,14 @@ function planBillingInterval(plan) {
4728
4728
  return (0, import_core8.billingCycle)(plan)?.interval ?? null;
4729
4729
  }
4730
4730
  function formatPaygRate(plan, locale, balance) {
4731
+ const rate = (0, import_core8.usageRate)(plan);
4732
+ if (!rate || !(rate.amountMinor > 0)) return null;
4733
+ const prefix = rate.tiered ? "from " : "";
4731
4734
  const credits = (0, import_core8.creditsPerUnitFromBalance)(plan, balance);
4732
4735
  if (credits != null) {
4733
- return `${credits.toLocaleString(locale)} ${credits === 1 ? "credit" : "credits"} / call`;
4736
+ return `${prefix}${credits.toLocaleString(locale)} ${credits === 1 ? "credit" : "credits"} / call`;
4734
4737
  }
4735
- const charge = (0, import_core8.perUnitCharge)(plan);
4736
- if (charge && charge.amountMinor > 0) {
4737
- return `${formatPrice(charge.amountMinor, charge.currency.toUpperCase(), { locale })} / call`;
4738
- }
4739
- return null;
4738
+ return `${prefix}${formatPrice(rate.amountMinor, rate.currency.toUpperCase(), { locale })} / call`;
4740
4739
  }
4741
4740
  function inferIncludedUnits(plan) {
4742
4741
  const cap = (0, import_core8.includedUnits)(plan);
@@ -6080,20 +6079,23 @@ function resolveTaxIdHelperText(country) {
6080
6079
  }
6081
6080
  return "";
6082
6081
  }
6082
+ var REVERSE_CHARGE_NOTE = "VAT reverse charge applies \u2014 you are responsible for reporting VAT in your jurisdiction.";
6083
+ var TAX_NOT_COLLECTED_NOTE = "Tax is not collected on this purchase.";
6083
6084
  function formatVatSummaryLabel(breakdown) {
6084
6085
  if (breakdown.treatment === "reverse_charge") {
6085
6086
  return "VAT (reverse charge)";
6086
6087
  }
6087
6088
  if (breakdown.taxRate > 0) {
6088
6089
  const ratePercent = breakdown.taxRate <= 1 ? Math.round(breakdown.taxRate * 100) : breakdown.taxRate;
6089
- return breakdown.inclusive ? `VAT (${ratePercent}%, incl.)` : `VAT (${ratePercent}%)`;
6090
+ return `VAT (${ratePercent}%)`;
6090
6091
  }
6091
6092
  return "VAT";
6092
6093
  }
6093
- function shouldShowTaxRow(treatment, taxRate) {
6094
- if (treatment === "not_collecting") return false;
6095
- if (treatment === "reverse_charge") return true;
6096
- return taxRate > 0;
6094
+ function shouldShowTaxRow(treatment) {
6095
+ return treatment !== "not_collecting" && treatment !== "not_supported";
6096
+ }
6097
+ function formatSubtotalLabel(treatment) {
6098
+ return shouldShowTaxRow(treatment) ? "Subtotal (excl. VAT)" : "Subtotal";
6097
6099
  }
6098
6100
  function createBusinessDetailsParts(useCtx, prefix) {
6099
6101
  const Root8 = (0, import_react37.forwardRef)(function BusinessDetailsRoot({ asChild, children, ...rest }, forwardedRef) {
@@ -6226,12 +6228,14 @@ function useSummaryAmounts(useCtx, part) {
6226
6228
  const taxMinor = ctx.taxBreakdown?.taxAmount ?? 0;
6227
6229
  const totalMinor = ctx.taxBreakdown?.total ?? ctx.baseAmountMinor;
6228
6230
  return {
6229
- subtotalFormatted: formatPrice(subtotalMinor, currency, { locale }),
6230
- taxFormatted: formatPrice(taxMinor, currency, { locale }),
6231
- totalFormatted: formatPrice(totalMinor, currency, { locale }),
6231
+ // `free: ''` — a summary line is an amount, not a price. Without it
6232
+ // formatPrice turns any zero (VAT, and a zero subtotal or total) into
6233
+ // the word "Free". DEV-723.
6234
+ subtotalFormatted: formatPrice(subtotalMinor, currency, { locale, free: "" }),
6235
+ taxFormatted: formatPrice(taxMinor, currency, { locale, free: "" }),
6236
+ totalFormatted: formatPrice(totalMinor, currency, { locale, free: "" }),
6232
6237
  taxRate: ctx.taxBreakdown?.taxRate ?? 0,
6233
6238
  treatment: ctx.taxBreakdown?.treatment ?? null,
6234
- inclusive: ctx.taxBreakdown?.inclusive ?? false,
6235
6239
  attaching: ctx.businessDetailsAttaching
6236
6240
  };
6237
6241
  }
@@ -6251,13 +6255,13 @@ function createTaxSummaryParts(useCtx, prefix) {
6251
6255
  });
6252
6256
  const Tax = (0, import_react37.forwardRef)(function TaxSummaryTax({ asChild, children, ...rest }, forwardedRef) {
6253
6257
  const ctx = useCtx("Summary.Tax");
6254
- const { taxFormatted, taxRate, treatment, inclusive } = useSummaryAmounts(useCtx, "Summary.Tax");
6258
+ const { taxFormatted, taxRate, treatment } = useSummaryAmounts(useCtx, "Summary.Tax");
6255
6259
  if (!ctx.isBusiness) return null;
6260
+ if (!shouldShowTaxRow(treatment)) return null;
6256
6261
  const Comp = asChild ? Slot : "span";
6257
6262
  const defaultLabel = formatVatSummaryLabel({
6258
6263
  treatment: treatment ?? "standard",
6259
- taxRate,
6260
- inclusive
6264
+ taxRate
6261
6265
  });
6262
6266
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Comp, { ref: forwardedRef, ...{ [attr(prefix, "summary-tax")]: "" }, ...rest, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
6263
6267
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: defaultLabel }),
@@ -6278,30 +6282,29 @@ function createTaxSummaryParts(useCtx, prefix) {
6278
6282
  if (!ctx.isBusiness) return null;
6279
6283
  if (!treatment || treatment === "standard") return null;
6280
6284
  const Comp = asChild ? Slot : "p";
6281
- const defaultNote = treatment === "reverse_charge" ? "VAT reverse charge applies \u2014 you are responsible for reporting VAT in your jurisdiction." : treatment === "not_collecting" ? "Tax is not collected on this purchase." : null;
6285
+ const defaultNote = treatment === "reverse_charge" ? REVERSE_CHARGE_NOTE : treatment === "not_collecting" || treatment === "not_supported" ? TAX_NOT_COLLECTED_NOTE : null;
6282
6286
  if (!defaultNote && !children) return null;
6283
6287
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Comp, { ref: forwardedRef, ...{ [attr(prefix, "summary-tax-note")]: "" }, ...rest, children: children ?? defaultNote });
6284
6288
  });
6285
6289
  const Rows = (0, import_react37.forwardRef)(function TaxSummaryRows({ asChild, children, ...rest }, forwardedRef) {
6286
6290
  const ctx = useCtx("Summary.Rows");
6287
- const { taxRate, treatment, inclusive, taxFormatted } = useSummaryAmounts(useCtx, "Summary.Rows");
6291
+ const { taxRate, treatment, taxFormatted } = useSummaryAmounts(useCtx, "Summary.Rows");
6288
6292
  if (!ctx.isBusiness) return null;
6289
- const showTaxRow = shouldShowTaxRow(treatment, taxRate);
6293
+ const showTaxRow = shouldShowTaxRow(treatment);
6290
6294
  const vatLabel = formatVatSummaryLabel({
6291
6295
  treatment: treatment ?? "standard",
6292
- taxRate,
6293
- inclusive
6296
+ taxRate
6294
6297
  });
6295
6298
  const content = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("dl", { className: "solvapay-tax-summary-rows", children: [
6296
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "solvapay-tax-summary-row", children: [
6297
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dt", { children: "Subtotal" }),
6299
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "solvapay-tax-summary-row", children: [
6300
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dt", { children: formatSubtotalLabel(treatment) }),
6298
6301
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Subtotal, {}) })
6299
6302
  ] }),
6300
- showTaxRow ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "solvapay-tax-summary-row", children: [
6303
+ showTaxRow ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "solvapay-tax-summary-row", children: [
6301
6304
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dt", { children: vatLabel }),
6302
6305
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { ...{ [attr(prefix, "summary-tax-amount")]: "" }, children: taxFormatted }) })
6303
6306
  ] }) : null,
6304
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "solvapay-tax-summary-row solvapay-tax-summary-row--total", children: [
6307
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "solvapay-tax-summary-row solvapay-tax-summary-row--total", children: [
6305
6308
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dt", { children: "Total" }),
6306
6309
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Total, {}) })
6307
6310
  ] }),
@@ -7007,11 +7010,7 @@ var PaygPaymentStep = (0, import_react40.memo)(function PaygPaymentStep2({
7007
7010
  }
7008
7011
  )
7009
7012
  ] }),
7010
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(TopupForm.Summary.Root, { className: cx.taxSummary, children: [
7011
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TopupForm.Summary.Subtotal, {}),
7012
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TopupForm.Summary.Tax, {}),
7013
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TopupForm.Summary.Total, {})
7014
- ] }),
7013
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TopupForm.Summary.Rows, { className: cx.taxSummary }),
7015
7014
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TopupForm.PaymentElement, {}),
7016
7015
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TopupForm.Error, { className: cx.error }),
7017
7016
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "solvapay-mcp-checkout-save-card", children: [
@@ -7295,9 +7294,9 @@ var Root6 = (0, import_react44.forwardRef)(function CheckoutSummaryRoot({ planRe
7295
7294
  const subtotalMinor = taxBreakdown?.subtotal ?? baseAmountMinor;
7296
7295
  const taxMinor = taxBreakdown?.taxAmount ?? 0;
7297
7296
  const totalMinor = taxBreakdown?.total ?? baseAmountMinor;
7298
- const subtotalFormatted = formatPrice(subtotalMinor, taxCurrency, { locale });
7299
- const taxFormatted = formatPrice(taxMinor, taxCurrency, { locale });
7300
- const totalFormatted = formatPrice(totalMinor, taxCurrency, { locale });
7297
+ const subtotalFormatted = formatPrice(subtotalMinor, taxCurrency, { locale, free: "" });
7298
+ const taxFormatted = formatPrice(taxMinor, taxCurrency, { locale, free: "" });
7299
+ const totalFormatted = formatPrice(totalMinor, taxCurrency, { locale, free: "" });
7301
7300
  const ctx = (0, import_react44.useMemo)(
7302
7301
  () => ({
7303
7302
  plan,
@@ -7358,9 +7357,10 @@ var SubtotalSlot = (0, import_react44.forwardRef)(function CheckoutSummarySubtot
7358
7357
  var TaxSlot = (0, import_react44.forwardRef)(function CheckoutSummaryTax({ asChild, children, ...rest }, forwardedRef) {
7359
7358
  const ctx = useCheckoutSummaryContext("Tax");
7360
7359
  if (!ctx.taxBreakdown) return null;
7361
- const Comp = asChild ? Slot : "span";
7362
7360
  const { taxRate, treatment } = ctx.taxBreakdown;
7363
- const defaultLabel = treatment === "reverse_charge" ? `VAT reverse charge (${ctx.taxFormatted})` : taxRate != null ? `Tax (${Math.round(taxRate * 100)}%)` : "Tax";
7361
+ if (!shouldShowTaxRow(treatment)) return null;
7362
+ const Comp = asChild ? Slot : "span";
7363
+ const defaultLabel = formatVatSummaryLabel({ treatment, taxRate: taxRate ?? 0 });
7364
7364
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Comp, { ref: forwardedRef, "data-solvapay-checkout-summary-tax": "", ...rest, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
7365
7365
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: defaultLabel }),
7366
7366
  " ",
@@ -7379,7 +7379,7 @@ var TaxTreatmentNoteSlot = (0, import_react44.forwardRef)(
7379
7379
  const treatment = ctx.taxBreakdown?.treatment;
7380
7380
  if (!treatment || treatment === "standard") return null;
7381
7381
  const Comp = asChild ? Slot : "p";
7382
- const defaultNote = treatment === "reverse_charge" ? "VAT reverse charge applies \u2014 you are responsible for reporting VAT in your jurisdiction." : treatment === "not_collecting" ? "Tax is not collected on this purchase." : null;
7382
+ const defaultNote = treatment === "reverse_charge" ? REVERSE_CHARGE_NOTE : treatment === "not_collecting" || treatment === "not_supported" ? TAX_NOT_COLLECTED_NOTE : null;
7383
7383
  if (!defaultNote && !children) return null;
7384
7384
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Comp, { ref: forwardedRef, "data-solvapay-checkout-summary-tax-treatment-note": "", ...rest, children: children ?? defaultNote });
7385
7385
  }
@@ -8562,12 +8562,7 @@ var RecurringPaymentStep = (0, import_react46.memo)(function RecurringPaymentSte
8562
8562
  }
8563
8563
  )
8564
8564
  ] }),
8565
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(PaymentForm.TaxSummary.Root, { className: cx.taxSummary, children: [
8566
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.TaxSummary.Subtotal, {}),
8567
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.TaxSummary.Tax, {}),
8568
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.TaxSummary.Total, {}),
8569
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.TaxSummary.TaxNote, {})
8570
- ] }),
8565
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.TaxSummary.Rows, { className: cx.taxSummary }),
8571
8566
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.PaymentElement, {}),
8572
8567
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.Error, { className: cx.error }),
8573
8568
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PaymentForm.MandateText, {}),
@@ -9346,11 +9341,7 @@ function EmbeddedTopup({
9346
9341
  }
9347
9342
  )
9348
9343
  ] }),
9349
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(TopupForm.Summary.Root, { className: cx.taxSummary, children: [
9350
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TopupForm.Summary.Subtotal, {}),
9351
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TopupForm.Summary.Tax, {}),
9352
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TopupForm.Summary.Total, {})
9353
- ] }),
9344
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TopupForm.Summary.Rows, { className: cx.taxSummary }),
9354
9345
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TopupForm.PaymentElement, {}),
9355
9346
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TopupForm.Error, { className: cx.error }),
9356
9347
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MandateText, { mode: "topup", amountMinor: committedAmountMinor, currency }),
@@ -1,4 +1,4 @@
1
- import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-BgyNW-D3.cjs';
1
+ import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-8vuWAyyz.cjs';
2
2
  import { TOOL_FOR_VIEW, SolvaPayMcpViewKind, BootstrapMerchant, BootstrapProduct, BootstrapPlan, BootstrapCustomer } from '@solvapay/mcp-core';
3
3
  export { MCP_TOOL_NAMES, McpToolName } from '@solvapay/mcp-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-BI78qUom.js';
1
+ import { v as SolvaPayTransport, _ as SolvaPayProviderInitial, z as SolvaPayConfig, D as BootstrapPlanLike, H as Merchant } from '../shared-DXOL9qKG.js';
2
2
  import { TOOL_FOR_VIEW, SolvaPayMcpViewKind, BootstrapMerchant, BootstrapProduct, BootstrapPlan, BootstrapCustomer } from '@solvapay/mcp-core';
3
3
  export { MCP_TOOL_NAMES, McpToolName } from '@solvapay/mcp-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
package/dist/mcp/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ExternalLinkGlyph,
4
4
  LaunchCustomerPortalButton,
5
5
  paymentMethodCache
6
- } from "../chunk-BHG7Z5XV.js";
6
+ } from "../chunk-3H6GEMK7.js";
7
7
  import {
8
8
  AmountPicker,
9
9
  BalanceBadge,
@@ -41,7 +41,7 @@ import {
41
41
  usePurchaseStatus,
42
42
  useTopupAmountSelector,
43
43
  useTransport
44
- } from "../chunk-GMZU5M6R.js";
44
+ } from "../chunk-JFW3WPVY.js";
45
45
  import "../chunk-UMXOAUW7.js";
46
46
  import "../chunk-MLKGABMK.js";
47
47
 
@@ -1086,11 +1086,7 @@ var PaygPaymentStep = memo3(function PaygPaymentStep2({
1086
1086
  }
1087
1087
  )
1088
1088
  ] }),
1089
- /* @__PURE__ */ jsxs6(TopupForm.Summary.Root, { className: cx.taxSummary, children: [
1090
- /* @__PURE__ */ jsx7(TopupForm.Summary.Subtotal, {}),
1091
- /* @__PURE__ */ jsx7(TopupForm.Summary.Tax, {}),
1092
- /* @__PURE__ */ jsx7(TopupForm.Summary.Total, {})
1093
- ] }),
1089
+ /* @__PURE__ */ jsx7(TopupForm.Summary.Rows, { className: cx.taxSummary }),
1094
1090
  /* @__PURE__ */ jsx7(TopupForm.PaymentElement, {}),
1095
1091
  /* @__PURE__ */ jsx7(TopupForm.Error, { className: cx.error }),
1096
1092
  /* @__PURE__ */ jsxs6("label", { className: "solvapay-mcp-checkout-save-card", children: [
@@ -1182,12 +1178,7 @@ var RecurringPaymentStep = memo4(function RecurringPaymentStep2({
1182
1178
  }
1183
1179
  )
1184
1180
  ] }),
1185
- /* @__PURE__ */ jsxs7(PaymentForm.TaxSummary.Root, { className: cx.taxSummary, children: [
1186
- /* @__PURE__ */ jsx8(PaymentForm.TaxSummary.Subtotal, {}),
1187
- /* @__PURE__ */ jsx8(PaymentForm.TaxSummary.Tax, {}),
1188
- /* @__PURE__ */ jsx8(PaymentForm.TaxSummary.Total, {}),
1189
- /* @__PURE__ */ jsx8(PaymentForm.TaxSummary.TaxNote, {})
1190
- ] }),
1181
+ /* @__PURE__ */ jsx8(PaymentForm.TaxSummary.Rows, { className: cx.taxSummary }),
1191
1182
  /* @__PURE__ */ jsx8(PaymentForm.PaymentElement, {}),
1192
1183
  /* @__PURE__ */ jsx8(PaymentForm.Error, { className: cx.error }),
1193
1184
  /* @__PURE__ */ jsx8(PaymentForm.MandateText, {}),
@@ -1966,11 +1957,7 @@ function EmbeddedTopup({
1966
1957
  }
1967
1958
  )
1968
1959
  ] }),
1969
- /* @__PURE__ */ jsxs11(TopupForm.Summary.Root, { className: cx.taxSummary, children: [
1970
- /* @__PURE__ */ jsx12(TopupForm.Summary.Subtotal, {}),
1971
- /* @__PURE__ */ jsx12(TopupForm.Summary.Tax, {}),
1972
- /* @__PURE__ */ jsx12(TopupForm.Summary.Total, {})
1973
- ] }),
1960
+ /* @__PURE__ */ jsx12(TopupForm.Summary.Rows, { className: cx.taxSummary }),
1974
1961
  /* @__PURE__ */ jsx12(TopupForm.PaymentElement, {}),
1975
1962
  /* @__PURE__ */ jsx12(TopupForm.Error, { className: cx.error }),
1976
1963
  /* @__PURE__ */ jsx12(MandateText, { mode: "topup", amountMinor: committedAmountMinor, currency }),
@@ -523,24 +523,37 @@ body {
523
523
  font-size: 13px;
524
524
  }
525
525
 
526
- .solvapay-mcp-tax-summary [data-solvapay-topup-form-summary-subtotal],
527
- .solvapay-mcp-tax-summary [data-solvapay-topup-form-summary-tax],
528
- .solvapay-mcp-tax-summary [data-solvapay-topup-form-summary-total],
529
- .solvapay-mcp-tax-summary [data-solvapay-payment-form-summary-subtotal],
530
- .solvapay-mcp-tax-summary [data-solvapay-payment-form-summary-tax],
531
- .solvapay-mcp-tax-summary [data-solvapay-payment-form-summary-total] {
526
+ .solvapay-mcp-tax-summary .solvapay-tax-summary-rows {
527
+ margin: 0;
528
+ display: flex;
529
+ flex-direction: column;
530
+ gap: 6px;
531
+ }
532
+
533
+ .solvapay-mcp-tax-summary .solvapay-tax-summary-row {
532
534
  display: flex;
533
535
  justify-content: space-between;
534
536
  gap: 12px;
535
537
  }
536
538
 
537
- .solvapay-mcp-tax-summary [data-solvapay-topup-form-summary-total],
538
- .solvapay-mcp-tax-summary [data-solvapay-payment-form-summary-total] {
539
+ .solvapay-mcp-tax-summary .solvapay-tax-summary-row dt,
540
+ .solvapay-mcp-tax-summary .solvapay-tax-summary-row dd {
541
+ margin: 0;
542
+ }
543
+
544
+ .solvapay-mcp-tax-summary .solvapay-tax-summary-row--total {
539
545
  font-weight: 600;
540
546
  padding-top: 6px;
541
547
  border-top: 1px solid var(--color-border-secondary, #e2e8f0);
542
548
  }
543
549
 
550
+ .solvapay-mcp-tax-summary [data-solvapay-topup-form-summary-tax-note],
551
+ .solvapay-mcp-tax-summary [data-solvapay-payment-form-summary-tax-note] {
552
+ margin: 0;
553
+ font-size: 12px;
554
+ color: var(--color-text-secondary, #475569);
555
+ }
556
+
544
557
  /* Pay-with-card step header: amount being purchased is the hero, the
545
558
  * customer's existing balance drops to a muted context line. The
546
559
  * AmountPicker step and the Success step keep the prominent