@flopay/react 1.15.0 → 1.16.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.
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from 'react';
2
+ /** The link's wording when the merchant sets no `moreOptionsLabel`. */
3
+ export declare const DEFAULT_MORE_OPTIONS_LABEL = "More payment options";
4
+ /**
5
+ * The closed "More payment options" link and the payment method groups
6
+ * behind it. Opening reveals the groups in place for good: the link goes and
7
+ * focus moves to the revealed section, which is labelled with the link's
8
+ * text. Without `showLink` (nothing behind it is available) the groups stay
9
+ * mounted and hidden, and there is no link.
10
+ */
11
+ export declare function MorePaymentOptions({ label, open, showLink, onOpen, color, fontFamily, children, }: {
12
+ label: string;
13
+ open: boolean;
14
+ showLink: boolean;
15
+ onOpen: () => void;
16
+ color: string;
17
+ fontFamily?: string;
18
+ children: ReactNode;
19
+ }): import("react").JSX.Element;
@@ -173,8 +173,23 @@ export interface SplitCardFormProps {
173
173
  * paying. Hiding a group stays the job of `showPayPal` / `showStripe` /
174
174
  * `enabledPaymentMethods`. Billing API warnings about invalid rules are
175
175
  * logged to the console.
176
+ *
177
+ * `moreOptions` (default and per country) puts groups behind a closed
178
+ * "More payment options" link: under the buttons on the buttons layout,
179
+ * and under the buttons, above "or pay with card", on the default layout,
180
+ * where the card form always stays in view. Opening it reveals them in the
181
+ * resolved order for good and emits `more_options_opened` on
182
+ * `onInstrument`. When nothing available would stay in view every group
183
+ * shows without a link, and when nothing behind it is available there is
184
+ * no link.
176
185
  */
177
186
  paymentMethodLayout?: PaymentMethodLayoutRules;
187
+ /**
188
+ * The text of the "More payment options" link that `paymentMethodLayout`'s
189
+ * `moreOptions` adds. Pass final, already-localized plain text; omit it for
190
+ * the default, "More payment options".
191
+ */
192
+ moreOptionsLabel?: string;
178
193
  /**
179
194
  * High-level theme bundle that styles non-card Stripe Elements, the FloPay
180
195
  * wrapper / AVS inputs, and the hosted vault widget. One of:
@@ -1,4 +1,4 @@
1
- import { type PaymentMethodGroup, type PaymentMethodLayoutRules } from '@flopay/shared';
1
+ import { type PaymentMethodGroupLayout, type PaymentMethodLayoutRules } from '@flopay/shared';
2
2
  /**
3
3
  * How long the checkout waits for the billing API's layout before it shows
4
4
  * the merchant's default order instead. A later answer is then ignored, so
@@ -6,16 +6,22 @@ import { type PaymentMethodGroup, type PaymentMethodLayoutRules } from '@flopay/
6
6
  */
7
7
  export declare const PAYMENT_METHOD_LAYOUT_TIMEOUT_MS = 1500;
8
8
  /**
9
- * The order to render the payment method groups in. Without rules it is the
10
- * default order, straight away and without a request. With rules, the billing
11
- * API resolves it for this buyer, and `null` means the first answer is still
9
+ * The order to render the payment method groups in, and the groups behind
10
+ * "More payment options". Without rules it is the default order with no
11
+ * link, straight away and without a request. With rules, the billing API
12
+ * resolves it for this buyer, and `null` means the first answer is still
12
13
  * pending: render placeholders, not methods that might move. A slow, failed
13
- * or older billing API gives the merchant's default order. When the rules
14
- * change, the previous order stays until the new one is known.
14
+ * or older billing API gives the merchant's default rule. When the rules
15
+ * change, the previous layout stays until the new one is known.
16
+ *
17
+ * `waitForSession` holds the request while an inline session's details are
18
+ * still being attached (the background claim): the buyer's country arrives
19
+ * with them, so asking earlier would pick the rule without it.
15
20
  */
16
- export declare function usePaymentMethodLayout({ rules, sessionId, nonce, billingApiUrl, }: {
21
+ export declare function usePaymentMethodLayout({ rules, sessionId, nonce, billingApiUrl, waitForSession, }: {
17
22
  rules: PaymentMethodLayoutRules | undefined;
18
23
  sessionId: string;
19
24
  nonce: string | undefined;
20
25
  billingApiUrl: string | undefined;
21
- }): readonly PaymentMethodGroup[] | null;
26
+ waitForSession: boolean;
27
+ }): PaymentMethodGroupLayout | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/react",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
@@ -36,8 +36,8 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@flopay/js": "1.15.0",
40
- "@flopay/shared": "1.15.0",
39
+ "@flopay/js": "1.16.0",
40
+ "@flopay/shared": "1.16.0",
41
41
  "@paypal/paypal-js": "^11.3.0",
42
42
  "@stripe/react-stripe-js": "^7.0.1",
43
43
  "@stripe/stripe-js": "^10.3.0"