@flopay/js 1.20.4 → 1.20.6

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.
@@ -34,6 +34,11 @@ export interface CheckoutRuntimeContract {
34
34
  * compatibility"), and each released version keeps a frozen copy in ./baselines.
35
35
  */
36
36
  export declare const CHECKOUT_RUNTIME_CONTRACT_VERSION: string;
37
+ /**
38
+ * The first released contract version: the one a wrapper that declares no `contractVersion`
39
+ * (one built before versions existed) runs under.
40
+ */
41
+ export declare const CHECKOUT_RUNTIME_BASELINE_CONTRACT_VERSION: string;
37
42
  /**
38
43
  * The closed set of neutral meanings a contract member may have. Every member names what it is
39
44
  * for (a payment method, an outcome, the session, the page's wording, ...), never the processor
@@ -1,3 +1,4 @@
1
+ import type { PaymentMethodLayoutRules } from '@flopay/shared';
1
2
  /** The events the runtime relays to the wrapper, with the payloads the 1.x checkout emitted. */
2
3
  export type CheckoutRuntimeEventName = 'complete' | 'decline' | 'error' | 'cancel' | 'instruments' | 'cardFieldsReady' | 'cardFieldsFailed';
3
4
  export interface CheckoutRuntimeEvent {
@@ -30,9 +31,20 @@ export interface CheckoutRuntimeMountOptions {
30
31
  * read as the 2.0.0 baseline.
31
32
  */
32
33
  contractVersion?: string;
34
+ /**
35
+ * The merchant's payment method layout rules (contract 2.1.0). The runtime sends them to the
36
+ * billing API, which picks the buyer's rule, and hands the frame the layout it answers.
37
+ * Without rules, or when the API cannot answer, the frame keeps the 1.x default
38
+ * presentation. The runtime never sends or looks up a buyer country.
39
+ */
40
+ paymentMethodLayout?: PaymentMethodLayoutRules;
33
41
  }
34
- /** The options a mounted checkout accepts after it is mounted. */
35
- export type CheckoutRuntimeUpdateOptions = Partial<Pick<CheckoutRuntimeMountOptions, 'appearance' | 'strings' | 'onEvent'>>;
42
+ /**
43
+ * The options a mounted checkout accepts after it is mounted. As with `appearance` and
44
+ * `strings`, leaving `paymentMethodLayout` out (or `undefined`) keeps the current layout; new
45
+ * rules are resolved again by the API and the frame gets the new layout in the same frame.
46
+ */
47
+ export type CheckoutRuntimeUpdateOptions = Partial<Pick<CheckoutRuntimeMountOptions, 'appearance' | 'strings' | 'onEvent' | 'paymentMethodLayout'>>;
36
48
  export interface CheckoutRuntimeHandle {
37
49
  update(options: CheckoutRuntimeUpdateOptions): void;
38
50
  unmount(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/js",
3
- "version": "1.20.4",
3
+ "version": "1.20.6",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
@@ -31,7 +31,7 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@flopay/shared": "1.20.4",
34
+ "@flopay/shared": "1.20.6",
35
35
  "@stripe/stripe-js": "^10.3.0"
36
36
  },
37
37
  "devDependencies": {