@funnelsgrove/payments 0.43.0 → 0.44.0

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
@@ -95,6 +95,20 @@ hooks; wallet surfaces accept it through their `checkout` input. Stripe clients
95
95
  cached by publishable key and locale so changing language cannot reuse another
96
96
  language's client. Locale does not change a plan, currency or billing interval.
97
97
 
98
+ For Solidgate, pass `language: 'es'` to `prepareSolidgateCheckout`, or inside
99
+ `SolidgateCheckoutDialog.request`, to use Spanish for the provider form:
100
+
101
+ ```ts
102
+ const checkout = await prepareSolidgateCheckout({ ...checkoutRequest, language: 'es' });
103
+ ```
104
+
105
+ Use a [supported Solidgate language tag](https://docs.solidgate.com/payments/integrate/payment-form/form-insights/implementation-tips/#supported-translations).
106
+ Map regional funnel locales explicitly (for example, `es-ES` to `es`); the API rejects
107
+ unsupported tags. Omitted/null language preserves browser selection. The dialog
108
+ captures language when preparing the attempt; close and reopen it to adopt a change.
109
+ Funnel-owned dialog text still comes from `content` and `presentation`.
110
+ See the [checkout language contract](../../docs/product-specs/billing.md#solidgate-checkout-language).
111
+
98
112
  `ManageSubscriptionContent` exported by this package extends the runtime content
99
113
  with optional `labels: ManageSubscriptionLabels`. A localized funnel should make
100
114
  `labels` required in its own content type and provide the complete English and
@@ -1 +1 @@
1
- export declare const PAYMENTS_PACKAGE_VERSION = "0.43.0";
1
+ export declare const PAYMENTS_PACKAGE_VERSION = "0.44.0";
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/generate-package-version.mjs.
2
- export const PAYMENTS_PACKAGE_VERSION = "0.43.0";
2
+ export const PAYMENTS_PACKAGE_VERSION = "0.44.0";
@@ -106,7 +106,7 @@ export function SolidgateCheckoutDialog({ open, layout = 'dialog', request, cust
106
106
  setCommittedEmail(normalizedCustomerEmail);
107
107
  setEmailError(null);
108
108
  }, [customerEmail, normalizedCustomerEmail]);
109
- const { discountKeyOrProviderId, failUrl, funnelPlanKey, paymentProfileId, providerPlanId, checkoutType, environment, funnelEndUserId, funnelId, idempotencyKey, offerSetId, returnUrl, runtimeConfig, successUrl, } = request;
109
+ const { discountKeyOrProviderId, failUrl, funnelPlanKey, paymentProfileId, providerPlanId, checkoutType, environment, language, funnelEndUserId, funnelId, idempotencyKey, offerSetId, returnUrl, runtimeConfig, successUrl, } = request;
110
110
  const checkoutKey = (retryRequest === null || retryRequest === void 0 ? void 0 : retryRequest.originalKey) === idempotencyKey
111
111
  ? retryRequest.key : idempotencyKey;
112
112
  const retryAttemptId = (retryRequest === null || retryRequest === void 0 ? void 0 : retryRequest.originalKey) === idempotencyKey ? retryRequest.attemptId : request.retryAttemptId;
@@ -121,6 +121,7 @@ export function SolidgateCheckoutDialog({ open, layout = 'dialog', request, cust
121
121
  providerPlanId: (providerPlanId === null || providerPlanId === void 0 ? void 0 : providerPlanId.trim()) || null,
122
122
  checkoutType: checkoutType || null,
123
123
  environment: environment || null,
124
+ language,
124
125
  idempotencyKey: checkoutKey.trim(),
125
126
  retryAttemptId,
126
127
  discountKeyOrProviderId: (discountKeyOrProviderId === null || discountKeyOrProviderId === void 0 ? void 0 : discountKeyOrProviderId.trim()) || null,
@@ -143,6 +144,7 @@ export function SolidgateCheckoutDialog({ open, layout = 'dialog', request, cust
143
144
  providerPlanId,
144
145
  checkoutType,
145
146
  environment,
147
+ language,
146
148
  funnelEndUserId,
147
149
  funnelId,
148
150
  funnelSdkPublishableKey,
@@ -34,6 +34,8 @@ export type PrepareSolidgateCheckoutInput = {
34
34
  providerPlanId?: string | null;
35
35
  checkoutType?: 'subscription' | 'one_time' | null;
36
36
  environment?: 'test' | 'live' | null;
37
+ /** Solidgate form language tag (for example, 'es'); omitted/null uses browser language. */
38
+ language?: string | null;
37
39
  idempotencyKey: string;
38
40
  retryAttemptId?: string | null;
39
41
  discountKeyOrProviderId?: string | null;
@@ -129,8 +129,8 @@ export const prepareSolidgateCheckout = async (input) => {
129
129
  if (!paymentProfileId || !providerPlanId || !checkoutType || !environment) {
130
130
  throw new Error('Solidgate V2 checkout selection is incomplete');
131
131
  }
132
- const result = parsePreparation(await postJson('/sdk/public/v2/payments/checkout-sessions', Object.assign(Object.assign({ checkoutType, uiMode: 'custom', environment,
133
- paymentProfileId, provider: 'solidgate', providerPlanId, planKey: requiredString(input.funnelPlanKey, 'funnelPlanKey'), funnelId: resolveFunnelId(input.funnelId, input.runtimeConfig), funnelEndUserId: requiredString(input.funnelEndUserId, 'funnelEndUserId'), offerSetId: requiredString(input.offerSetId, 'offerSetId'), idempotencyKey: requiredString(input.idempotencyKey, 'idempotencyKey') }, (input.retryAttemptId ? { retryAttemptId: input.retryAttemptId } : {})), { couponId: ((_c = input.discountKeyOrProviderId) === null || _c === void 0 ? void 0 : _c.trim()) || null, returnUrl: paywallCheckoutReturnUrl(requiredString(input.returnUrl, 'returnUrl'), 'solidgate'), successUrl: paywallCheckoutReturnUrl(requiredString(input.successUrl, 'successUrl'), 'solidgate'), failUrl: paywallCheckoutReturnUrl(requiredString(input.failUrl, 'failUrl'), 'solidgate', true) }), input.runtimeConfig, input.signal));
132
+ const result = parsePreparation(await postJson('/sdk/public/v2/payments/checkout-sessions', Object.assign(Object.assign(Object.assign({ checkoutType, uiMode: 'custom', environment,
133
+ paymentProfileId, provider: 'solidgate', providerPlanId, planKey: requiredString(input.funnelPlanKey, 'funnelPlanKey'), funnelId: resolveFunnelId(input.funnelId, input.runtimeConfig), funnelEndUserId: requiredString(input.funnelEndUserId, 'funnelEndUserId'), offerSetId: requiredString(input.offerSetId, 'offerSetId'), idempotencyKey: requiredString(input.idempotencyKey, 'idempotencyKey') }, (input.language != null ? { language: input.language } : {})), (input.retryAttemptId ? { retryAttemptId: input.retryAttemptId } : {})), { couponId: ((_c = input.discountKeyOrProviderId) === null || _c === void 0 ? void 0 : _c.trim()) || null, returnUrl: paywallCheckoutReturnUrl(requiredString(input.returnUrl, 'returnUrl'), 'solidgate'), successUrl: paywallCheckoutReturnUrl(requiredString(input.successUrl, 'successUrl'), 'solidgate'), failUrl: paywallCheckoutReturnUrl(requiredString(input.failUrl, 'failUrl'), 'solidgate', true) }), input.runtimeConfig, input.signal));
134
134
  retainPaywallCheckout('solidgate', result.attemptId);
135
135
  return result;
136
136
  };
@@ -285,7 +285,7 @@ export const buildDiscountedPaywallPlans = (input) => {
285
285
  ? discountedMoney
286
286
  ? formatProviderMoney(discountedMoney, locale)
287
287
  : formatMoneyFromCents(discountedAmountCents, planCurrency, locale)
288
- : plan.priceLabel, oldPriceLabel: hasActiveDiscount ? plan.priceLabel : plan.priceBeforeDiscount, perDayAmount: hasActiveDiscount ? discountedPerDayAmount : plan.perDayAmount, baseAmountCents: plan.amountCents, basePriceLabel: plan.priceLabel, basePerDayAmount: plan.perDayAmount, oldPerDayAmount: hasActiveDiscount ? plan.perDayAmount : null, couponId: hasActiveDiscount ? input.couponId : null, hasActiveDiscount });
288
+ : plan.priceLabel, oldPriceLabel: hasActiveDiscount ? plan.priceLabel : undefined, perDayAmount: hasActiveDiscount ? discountedPerDayAmount : plan.perDayAmount, baseAmountCents: plan.amountCents, basePriceLabel: plan.priceLabel, basePerDayAmount: plan.perDayAmount, oldPerDayAmount: hasActiveDiscount ? plan.perDayAmount : null, couponId: hasActiveDiscount ? input.couponId : null, hasActiveDiscount });
289
289
  });
290
290
  };
291
291
  export const getPaywallPromoDisplayName = (referenceMs) => {
@@ -11,8 +11,6 @@ export type PaywallPlan = {
11
11
  providerPlanId?: string;
12
12
  priceLabel: string;
13
13
  oldPriceLabel?: string;
14
- /** Display-only price shown crossed out when no coupon discount is active. */
15
- priceBeforeDiscount?: string;
16
14
  featuredTag?: string;
17
15
  perDayAmount: string;
18
16
  perDayLabel: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/payments",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",