@flopay/react 1.16.6 → 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
@@ -128,6 +128,20 @@ Set `cardAutoFocus={false}` on `FloPayCheckout` or `SplitCardForm` to turn that
128
128
  - **Default.** Omitted or `true` keeps the existing behaviour. `true` does not make the card form take focus over identity or AVS fields rendered above it.
129
129
  - **Custom layouts.** `FloPayCheckout` forwards the prop to its built-in form. A `SplitCardForm` you render as a custom-layout child takes its own `cardAutoFocus`.
130
130
 
131
+ #### Card brand icons
132
+
133
+ Set `showCardBrandIcons` on `FloPayCheckout` or `SplitCardForm` to show the Visa, Mastercard, Amex and Discover icons on the right of the hosted card number field:
134
+
135
+ ```tsx
136
+ <FloPayCheckout sessionId={sessionId} nonce={sessionNonce} showCardBrandIcons />
137
+ ```
138
+
139
+ - **Opt-in.** Only `true` turns the icons on. Omitted or `false` leaves the card form exactly as it was.
140
+ - **Live updates.** Changing the prop updates the hosted form in place, without remounting it or clearing entered card details. The SDK re-sends the setting whenever the hosted form becomes ready again.
141
+ - **Brand narrowing.** The hosted form narrows the icons to the brand the buyer types. The SDK does nothing for that, and no brand is reported back to your page.
142
+ - **Compatibility.** A billing API whose card form predates the icons ignores the setting and keeps the field as it was.
143
+ - **Custom layouts.** `FloPayCheckout` forwards the prop to its built-in form. A `SplitCardForm` you render as a custom-layout child takes its own `showCardBrandIcons`.
144
+
131
145
  #### Wallets and alternative payment methods
132
146
 
133
147
  The payment-method list is gateway-driven: the billing API sends `gateways.stripe.enabledPaymentMethods` for each session, derived from the payment methods enabled on the merchant's Stripe account. Apple Pay, Google Pay, PayPal, Link, Amazon Pay, and Klarna render as express buttons; every other enabled method (for example Cash App Pay, Affirm, iDEAL, Bancontact, SEPA Debit) renders in an accordion. Enabling a new method in Stripe needs no SDK or application change. Wallets render only on supported devices.
@@ -707,6 +721,7 @@ export function ComposedCheckout({ session, nonce }: { session: CheckoutSession;
707
721
  | `enableAVS` | `boolean \| AVSFieldConfig` | Collect and validate the billing address |
708
722
  | `avsLayout` | `'row' \| 'column'` | AVS field layout |
709
723
  | `cardFieldOrder` | `VaultCardFieldKey[]?` | Order of the hosted card rows |
724
+ | `showCardBrandIcons` | `boolean?` | Set `true` to show the Visa, Mastercard, Amex and Discover icons in the hosted card number field; omitted or `false` keeps the field as it is |
710
725
  | `cardAutoFocus` | `boolean?` | Set `false` to stop the checkout focusing the card form (or the identity/AVS field above it) when it opens; omitted or `true` keeps the default |
711
726
  | `cardFieldsTimeoutMs` | `number?` | Milliseconds the card fields may take to become interactive before `onCardFieldsFailed` reports `timeout` (default 15 000) |
712
727
  | `onCardFieldsReady` | `(event: CardFieldsReadyEvent) => void` | The hosted card fields are interactive; once per card form, with `elapsedMs` since it mounted |
@@ -820,6 +835,7 @@ Also accepts every standard `button` attribute, such as `onClick`, `disabled`, a
820
835
  | `enabledPaymentMethods` | `string[]?` | Stripe method identifiers; `card` advertises the hosted card form |
821
836
  | `enableAVS` | `boolean \| AVSFieldConfig` | Collect and validate the billing address |
822
837
  | `cardFieldOrder` | `VaultCardFieldKey[]?` | Order of the hosted card rows |
838
+ | `showCardBrandIcons` | `boolean?` | Set `true` to show the Visa, Mastercard, Amex and Discover icons in the hosted card number field; omitted or `false` keeps the field as it is |
823
839
  | `cardAutoFocus` | `boolean?` | Set `false` to stop the form focusing the hosted card (or the identity/AVS field above it) when it opens; omitted or `true` keeps the default |
824
840
  | `cardFieldsTimeoutMs` | `number?` | Milliseconds the card fields may take to become interactive before `onCardFieldsFailed` reports `timeout` (default 15 000) |
825
841
  | `onCardFieldsReady` / `onCardFieldsFailed` | callbacks | Card-field lifecycle; see **Card-field lifecycle** above |
@@ -182,6 +182,12 @@ export interface FloPayCheckoutProps {
182
182
  * (`name`, `number`, `expiry`). Vault card path only.
183
183
  */
184
184
  cardFieldOrder?: import('@flopay/shared').VaultCardFieldKey[];
185
+ /**
186
+ * Show the Visa, Mastercard, Amex and Discover icons in the hosted card number
187
+ * field. Only `true` turns them on; omitted or `false` keeps the field as it is.
188
+ * Vault card path only; an older hosted form ignores it.
189
+ */
190
+ showCardBrandIcons?: boolean;
185
191
  /**
186
192
  * Opt out of the hosted card widget's automatic initial focus (and the host-side
187
193
  * initial identity/AVS field focus). `false` disables it; omitted or `true` keeps
@@ -265,4 +271,4 @@ export interface FloPayCheckoutProps {
265
271
  * />
266
272
  * ```
267
273
  */
268
- export declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCancel, onCountryChange, onZipChange, showPayPal, showStripe, walletPresentation, enabledPaymentMethods: enabledPaymentMethodsProp, showApplePay, showGooglePay, debug, layout, paymentMethodLayout, moreOptionsLabel, theme, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter: _showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, cardFieldOrder, cardAutoFocus, onCardFieldsReady, onCardFieldsFailed, cardFieldsTimeoutMs, cardPreFormSlot, avsLayout, submitLabel, className, initialErrorMessage, initialPayPalOrderId, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;
274
+ export declare function FloPayCheckout({ sessionId: sessionIdProp, nonce: nonceProp, createSession: createSessionParams, billingApiUrl, telemetry, appearance: appearanceOverride, locale, loading: loadingNode, error: errorNode, onComplete, onError, onInstrument, onDecline, onCancel, onCountryChange, onZipChange, showPayPal, showStripe, walletPresentation, enabledPaymentMethods: enabledPaymentMethodsProp, showApplePay, showGooglePay, debug, layout, paymentMethodLayout, moreOptionsLabel, theme, buttonsTheme, buttonsStyles, cardButtonContent, cardBackButtonContent, cardTitleContent, showSecurityFooter: _showSecurityFooter, onButtonClick, onBeforeButtonClick, enableAVS, cardFieldOrder, showCardBrandIcons, cardAutoFocus, onCardFieldsReady, onCardFieldsFailed, cardFieldsTimeoutMs, cardPreFormSlot, avsLayout, submitLabel, className, initialErrorMessage, initialPayPalOrderId, children, checkoutMode: checkoutModeProp, confirmLabel, renderConfirmButton, onSessionCompleted, }: FloPayCheckoutProps): React.ReactElement;