@flopay/shared 1.20.2 → 1.20.4

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.
@@ -1,4 +1,27 @@
1
1
  import type { CheckoutSession, GatewayEnvironment, PayPalApprovalPresentation, PayPalProviderObjectType } from './types.js';
2
+ /** The parts of a session read that carry its advertisement. */
3
+ export interface CheckoutAdvertisement {
4
+ data: {
5
+ session?: CheckoutSession | null;
6
+ stripe?: unknown;
7
+ paypal?: unknown;
8
+ };
9
+ }
10
+ /**
11
+ * The advertisement a checkout shows once a claim response lands on it.
12
+ *
13
+ * A detached checkout mounts from a shell, a provisional advertisement made
14
+ * before the cart is known; the claim is the authority. The latest
15
+ * advertisement wins, provider by provider:
16
+ * - a provider the claim names wins, so `stripe: null` / `paypal: null`
17
+ * removes that provider's buttons even when the shell advertised them;
18
+ * - a provider key the claim leaves out (an older or partial API response)
19
+ * keeps what `current` advertised.
20
+ *
21
+ * This chooses no gateway: it only decides which response a provider entry is
22
+ * read from. Everything else comes from the claim.
23
+ */
24
+ export declare function applyClaimAdvertisement<T extends CheckoutAdvertisement>(current: T, claimed: T): T;
2
25
  /**
3
26
  * The PayPal gateway fields the direct PayPal button needs: the session's
4
27
  * `gateways.paypal`, or the normalized `data.paypal` copy of it.
@@ -1,6 +1,6 @@
1
1
  import type { AVSFieldConfig, ButtonsLayoutStyles, ButtonsLayoutTheme, CountryOption, CurrencyInfo, FloPayAppearance, ThemeBundle, ThemeBundleId, ThemeId } from './types.js';
2
2
  /** Current SDK version. */
3
- export declare const SDK_VERSION = "1.20.2";
3
+ export declare const SDK_VERSION = "1.20.4";
4
4
  /**
5
5
  * HTTP header the SDK sends on checkout-session create/read requests so the
6
6
  * backend can observe compatibility. Version 1.4.9 is the first release that