@flopay/shared 1.1.6 → 1.2.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
@@ -108,7 +108,8 @@ throw validationError('Email is required', 'email');
108
108
  | `PriceData` | `currency`, `unitAmount`, `productData`, `recurring?` |
109
109
  | `RecurringInterval` | `interval` (`'month'`/`'year'`), `intervalCount?` |
110
110
  | `BillingProvider` | `'recurly'` / `'chargebee'` / `'stripe'` |
111
- | `TokenizedBody` | `id?`, `type?`, `threeDSecureActionResultTokenId?`, `originalPaymentMethodId?`, `isPaypal?` |
111
+ | `TokenizedBody` | `id?`, `type?`, `threeDSecureActionResultTokenId?`, `originalPaymentMethodId?`, `gateway?` (`'stripe'` / `'paypal'` / custom), `paymentMethodType?` (Stripe wire identifier — `'card'`, `'apple_pay'`, `'cashapp'`, `'klarna'`, … for `gateway='stripe'`; `'paypal'` for `gateway='paypal'`), `isPaypal?` *(deprecated — replaced by `gateway` + `paymentMethodType`; still set for PayPal during the deprecation window so backends gating on `isPaypal === 'true'` keep working)* |
112
+ | `CheckoutGateway` | Per-gateway config from the billing API: `publishableKey?`, `environment?`, `stripeClientSecret?`, `paypalPublishableKey?`, `enabledPaymentMethods?` (Stripe-only — per-session list of Stripe method type identifiers that the gateway has enabled for this consumer; drives dynamic `ExpressCheckoutElement` / `PaymentElement` rendering in `@flopay/react`) |
112
113
  | `NormalizedCheckoutSession` | Provider-agnostic session: `provider`, `mode`, `data`, `raw?` |
113
114
  | `CheckoutModeKind` | `'tokenize'` / `'redirect'` |
114
115
  | `CreateSessionParams` | Full session creation params: `billingApiUrl`, `checkoutBaseUrl`, `clientId`, `currency` (required — SDK throws `FloPayError({ type: 'validation_error', code: 'CurrencyRequired' })` before issuing the request when none can be resolved), `products?` (unified shape; takes precedence), `items?`, `subscriptions?` (legacy — folded into `products[]` before send), `account`, `successUrl`, `cancelUrl`, `checkoutMode?`, `couponCodes?`, `tagsData?`, `redirectParams?`, `setCookie?`, `timeoutMs?`, `utmMetadata?` |
@@ -161,6 +162,9 @@ throw validationError('Email is required', 'email');
161
162
  | `resolveButtonsLayoutTheme(name)` | Map a `ButtonsLayoutTheme` name to its `ButtonsLayoutStyles` preset |
162
163
  | `ELEMENT_TYPES` | `['payment', 'card', 'cardNumber', 'cardExpiry', 'cardCvc', 'address']` |
163
164
  | `SUPPORTED_CARD_BRANDS` | `['visa', 'mastercard', 'mastercard_debit', 'amex', 'discover']` |
165
+ | `STRIPE_EXPRESS_METHODS` | `['apple_pay', 'google_pay', 'paypal', 'link', 'amazon_pay', 'klarna']` — Stripe method type identifiers supported by `ExpressCheckoutElement` (everything else returned in `gateways.stripe.enabledPaymentMethods` falls into the `PaymentElement` accordion in the React SDK) |
166
+ | `partitionStripeMethods(enabledMethods, { excludePaypal? })` | Split the backend's enabled list into `{ expressMethods, paymentElementMethods }`. Drops `card`; also drops `paypal` when `excludePaypal: true`. |
167
+ | `stripeExpressMethodToOptionKey(method)` | Map Stripe wire identifiers (`apple_pay`, `google_pay`, `amazon_pay`) to the camelCase keys (`applePay`, `googlePay`, `amazonPay`) expected by `ExpressCheckoutElement`'s `paymentMethods` options map. |
164
168
  | `CURRENCY_MAP` | Country code to `CurrencyInfo` mapping (EU, GB, US, CA, NZ, AU) |
165
169
  | `DEFAULT_CURRENCY` | USD fallback |
166
170