@flopay/vue 1.16.7 → 1.17.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
@@ -90,6 +90,16 @@ React `children` and custom layouts are slots. `FloPayCheckout`'s `layout` slot
90
90
 
91
91
  Entry points: `@flopay/vue`, `@flopay/vue/card-setup` and `@flopay/vue/payment-method-setup`.
92
92
 
93
+ ### Card brand icons
94
+
95
+ `FloPayCheckout` and `SplitCardForm` take the same `showCardBrandIcons` prop as React. Set it to `true` to show the Visa, Mastercard, Amex and Discover icons on the right of the hosted card number field:
96
+
97
+ ```ts
98
+ h(FloPayCheckout, { sessionId: 'sess_123', nonce: 'nonce_123', showCardBrandIcons: true });
99
+ ```
100
+
101
+ Only `true` turns the icons on; omitted or `false` leaves the card form exactly as it was. Changing the prop updates the hosted form in place, and the SDK re-sends it whenever the hosted form becomes ready again. The hosted form narrows the icons to the brand the buyer types; no brand is reported back to your page. A card form that predates the icons ignores the setting.
102
+
93
103
  ### PayPal buyer cancel
94
104
 
95
105
  `FloPayCheckout`, `SplitCardForm` and `DirectPayPalButton` emit `cancel` (`@cancel`, React's `onCancel`) once per click when the buyer closes the PayPal pop-up, or returns from PayPal's app switch, without approving. The payload is a `FloPayPaymentCancelEvent`: `{ status: 'cancelled', sessionId, provider: 'paypal', paymentMethodType }`. `sessionId` is the attempt's session (the click-time patch's, otherwise the checkout's), and `paymentMethodType` is `paypal_vaulted` when the session advertises an `order` or `setup_token`, otherwise `paypal`.
@@ -48,6 +48,12 @@ export interface FloPayCheckoutProps {
48
48
  * `['name', 'number', 'expiry']` (visual and tab order). Vault card path only.
49
49
  */
50
50
  cardFieldOrder?: VaultCardFieldKey[];
51
+ /**
52
+ * Show the Visa, Mastercard, Amex and Discover icons in the hosted card
53
+ * number field. Only `true` turns them on; omitted or `false` keeps the
54
+ * field as it is. Vault card path only. See React.
55
+ */
56
+ showCardBrandIcons?: boolean;
51
57
  /**
52
58
  * `false` turns off the card form's automatic initial focus when the
53
59
  * checkout opens. Omitted or `true` keeps the default. See React.
@@ -214,6 +220,10 @@ export declare const FloPayCheckout: import("vue").DefineComponent<import("vue")
214
220
  type: PropType<VaultCardFieldKey[]>;
215
221
  default: undefined;
216
222
  };
223
+ showCardBrandIcons: {
224
+ type: BooleanConstructor;
225
+ default: boolean;
226
+ };
217
227
  cardAutoFocus: {
218
228
  type: BooleanConstructor;
219
229
  default: boolean;
@@ -373,6 +383,10 @@ export declare const FloPayCheckout: import("vue").DefineComponent<import("vue")
373
383
  type: PropType<VaultCardFieldKey[]>;
374
384
  default: undefined;
375
385
  };
386
+ showCardBrandIcons: {
387
+ type: BooleanConstructor;
388
+ default: boolean;
389
+ };
376
390
  cardAutoFocus: {
377
391
  type: BooleanConstructor;
378
392
  default: boolean;
@@ -452,6 +466,7 @@ export declare const FloPayCheckout: import("vue").DefineComponent<import("vue")
452
466
  enableAVS: boolean | AVSFieldConfig;
453
467
  avsLayout: "column" | "row";
454
468
  cardFieldOrder: VaultCardFieldKey[];
469
+ showCardBrandIcons: boolean;
455
470
  cardAutoFocus: boolean;
456
471
  cardFieldsTimeoutMs: number;
457
472
  showSecurityFooter: boolean;
package/dist/index.cjs CHANGED
@@ -2304,6 +2304,7 @@ var SplitCardForm = (0, import_vue6.defineComponent)({
2304
2304
  appearance: { type: Object, default: void 0 },
2305
2305
  className: { type: String, default: void 0 },
2306
2306
  cardFieldOrder: { type: Array, default: void 0 },
2307
+ showCardBrandIcons: { type: Boolean, default: false },
2307
2308
  cardAutoFocus: { type: Boolean, default: true },
2308
2309
  /** Milliseconds the card fields may take to become ready before `timeout` (default 15 000). */
2309
2310
  cardFieldsTimeoutMs: { type: Number, default: void 0 },
@@ -3012,6 +3013,11 @@ var SplitCardForm = (0, import_vue6.defineComponent)({
3012
3013
  ([adapter, order, avs, autoFocus]) => adapter?.setCardFieldOrder?.(order ?? null, autoFocus !== false && avs == null),
3013
3014
  { immediate: true }
3014
3015
  );
3016
+ (0, import_vue6.watch)(
3017
+ () => [capture.value, props.showCardBrandIcons],
3018
+ ([adapter, show]) => adapter?.setCardBrandIcons?.(show === true),
3019
+ { immediate: true }
3020
+ );
3015
3021
  (0, import_vue6.watch)(gateClosed, (closed) => capture.value?.setSubmitGate?.(closed));
3016
3022
  });
3017
3023
  (0, import_vue6.onBeforeUnmount)(() => {
@@ -3665,6 +3671,7 @@ var FloPayCheckout = (0, import_vue7.defineComponent)({
3665
3671
  },
3666
3672
  avsLayout: { type: String, default: void 0 },
3667
3673
  cardFieldOrder: { type: Array, default: void 0 },
3674
+ showCardBrandIcons: { type: Boolean, default: false },
3668
3675
  cardAutoFocus: { type: Boolean, default: true },
3669
3676
  cardFieldsTimeoutMs: { type: Number, default: void 0 },
3670
3677
  /** @deprecated Not rendered (React parity); see {@link FloPayCheckoutProps.showSecurityFooter}. */
@@ -4073,6 +4080,7 @@ var FloPayCheckout = (0, import_vue7.defineComponent)({
4073
4080
  checkoutLayout: (0, import_shared9.resolveCheckoutLogLayout)(false, props.layout),
4074
4081
  avsLayout: props.avsLayout,
4075
4082
  cardFieldOrder: props.cardFieldOrder,
4083
+ showCardBrandIcons: props.showCardBrandIcons === true,
4076
4084
  cardAutoFocus: props.cardAutoFocus,
4077
4085
  cardFieldsTimeoutMs: props.cardFieldsTimeoutMs,
4078
4086
  session,
package/dist/index.mjs CHANGED
@@ -1204,6 +1204,7 @@ var SplitCardForm = defineComponent3({
1204
1204
  appearance: { type: Object, default: void 0 },
1205
1205
  className: { type: String, default: void 0 },
1206
1206
  cardFieldOrder: { type: Array, default: void 0 },
1207
+ showCardBrandIcons: { type: Boolean, default: false },
1207
1208
  cardAutoFocus: { type: Boolean, default: true },
1208
1209
  /** Milliseconds the card fields may take to become ready before `timeout` (default 15 000). */
1209
1210
  cardFieldsTimeoutMs: { type: Number, default: void 0 },
@@ -1912,6 +1913,11 @@ var SplitCardForm = defineComponent3({
1912
1913
  ([adapter, order, avs, autoFocus]) => adapter?.setCardFieldOrder?.(order ?? null, autoFocus !== false && avs == null),
1913
1914
  { immediate: true }
1914
1915
  );
1916
+ watch2(
1917
+ () => [capture.value, props.showCardBrandIcons],
1918
+ ([adapter, show]) => adapter?.setCardBrandIcons?.(show === true),
1919
+ { immediate: true }
1920
+ );
1915
1921
  watch2(gateClosed, (closed) => capture.value?.setSubmitGate?.(closed));
1916
1922
  });
1917
1923
  onBeforeUnmount3(() => {
@@ -2565,6 +2571,7 @@ var FloPayCheckout = defineComponent4({
2565
2571
  },
2566
2572
  avsLayout: { type: String, default: void 0 },
2567
2573
  cardFieldOrder: { type: Array, default: void 0 },
2574
+ showCardBrandIcons: { type: Boolean, default: false },
2568
2575
  cardAutoFocus: { type: Boolean, default: true },
2569
2576
  cardFieldsTimeoutMs: { type: Number, default: void 0 },
2570
2577
  /** @deprecated Not rendered (React parity); see {@link FloPayCheckoutProps.showSecurityFooter}. */
@@ -2973,6 +2980,7 @@ var FloPayCheckout = defineComponent4({
2973
2980
  checkoutLayout: resolveCheckoutLogLayout(false, props.layout),
2974
2981
  avsLayout: props.avsLayout,
2975
2982
  cardFieldOrder: props.cardFieldOrder,
2983
+ showCardBrandIcons: props.showCardBrandIcons === true,
2976
2984
  cardAutoFocus: props.cardAutoFocus,
2977
2985
  cardFieldsTimeoutMs: props.cardFieldsTimeoutMs,
2978
2986
  session,
@@ -110,6 +110,12 @@ export interface SplitCardFormProps {
110
110
  * Omit it for the default order. Vault card path only.
111
111
  */
112
112
  cardFieldOrder?: VaultCardFieldKey[];
113
+ /**
114
+ * Show the Visa, Mastercard, Amex and Discover icons in the hosted card
115
+ * number field. Only `true` turns them on; omitted or `false` keeps the
116
+ * field as it is. Vault card path only; an older hosted form ignores it.
117
+ */
118
+ showCardBrandIcons?: boolean;
113
119
  /**
114
120
  * `false` turns off the hosted card form's automatic initial focus, so the
115
121
  * page is not scrolled to the form when it opens. Omitted or `true` keeps
@@ -349,6 +355,10 @@ export declare const SplitCardForm: import("vue").DefineComponent<import("vue").
349
355
  type: PropType<VaultCardFieldKey[]>;
350
356
  default: undefined;
351
357
  };
358
+ showCardBrandIcons: {
359
+ type: BooleanConstructor;
360
+ default: boolean;
361
+ };
352
362
  cardAutoFocus: {
353
363
  type: BooleanConstructor;
354
364
  default: boolean;
@@ -579,6 +589,10 @@ export declare const SplitCardForm: import("vue").DefineComponent<import("vue").
579
589
  type: PropType<VaultCardFieldKey[]>;
580
590
  default: undefined;
581
591
  };
592
+ showCardBrandIcons: {
593
+ type: BooleanConstructor;
594
+ default: boolean;
595
+ };
582
596
  cardAutoFocus: {
583
597
  type: BooleanConstructor;
584
598
  default: boolean;
@@ -702,6 +716,7 @@ export declare const SplitCardForm: import("vue").DefineComponent<import("vue").
702
716
  appearance: FloPayAppearance;
703
717
  className: string;
704
718
  cardFieldOrder: VaultCardFieldKey[];
719
+ showCardBrandIcons: boolean;
705
720
  cardAutoFocus: boolean;
706
721
  cardFieldsTimeoutMs: number;
707
722
  onBeforeButtonClick: SplitCardFormBeforeButtonClick;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/vue",
3
- "version": "1.16.7",
3
+ "version": "1.17.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.16.7",
40
- "@flopay/shared": "1.16.7",
39
+ "@flopay/js": "1.17.0",
40
+ "@flopay/shared": "1.17.0",
41
41
  "@paypal/paypal-js": "^11.3.0",
42
42
  "@stripe/stripe-js": "^10.3.0"
43
43
  },