@flopay/react 0.5.0 → 0.5.1

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/dist/index.d.cts CHANGED
@@ -456,6 +456,14 @@ interface SplitCardFormProps {
456
456
  country?: string;
457
457
  /** Pre-filled ZIP/postal code for AVS. */
458
458
  zip?: string;
459
+ /** Pre-filled street address (line 1) for AVS. Typically from a partner GeoIP / profile lookup. */
460
+ addressLine1?: string;
461
+ /** Pre-filled apt/suite/unit (line 2) for AVS. */
462
+ addressLine2?: string;
463
+ /** Pre-filled city for AVS. Typically from a partner GeoIP / profile lookup. */
464
+ city?: string;
465
+ /** Pre-filled state/province for AVS. Typically from a partner GeoIP / profile lookup. */
466
+ state?: string;
459
467
  /** Callback when AVS country changes. */
460
468
  onCountryChange?: (country: string) => void;
461
469
  /** Callback when AVS ZIP/postal code changes. */
package/dist/index.d.ts CHANGED
@@ -456,6 +456,14 @@ interface SplitCardFormProps {
456
456
  country?: string;
457
457
  /** Pre-filled ZIP/postal code for AVS. */
458
458
  zip?: string;
459
+ /** Pre-filled street address (line 1) for AVS. Typically from a partner GeoIP / profile lookup. */
460
+ addressLine1?: string;
461
+ /** Pre-filled apt/suite/unit (line 2) for AVS. */
462
+ addressLine2?: string;
463
+ /** Pre-filled city for AVS. Typically from a partner GeoIP / profile lookup. */
464
+ city?: string;
465
+ /** Pre-filled state/province for AVS. Typically from a partner GeoIP / profile lookup. */
466
+ state?: string;
459
467
  /** Callback when AVS country changes. */
460
468
  onCountryChange?: (country: string) => void;
461
469
  /** Callback when AVS ZIP/postal code changes. */
package/dist/index.mjs CHANGED
@@ -1022,6 +1022,10 @@ function SplitCardFormInner({
1022
1022
  avsLayout: avsLayoutProp = "row",
1023
1023
  country: countryProp,
1024
1024
  zip: zipProp,
1025
+ addressLine1: addressLine1Prop,
1026
+ addressLine2: addressLine2Prop,
1027
+ city: cityProp,
1028
+ state: stateProp,
1025
1029
  onCountryChange,
1026
1030
  onZipChange,
1027
1031
  avsCheck: avsCheckProp,
@@ -1042,17 +1046,17 @@ function SplitCardFormInner({
1042
1046
  const [is3DSActive, setIs3DSActive] = useState2(false);
1043
1047
  const [selectedCountry, setSelectedCountry] = useState2(countryProp ?? "US");
1044
1048
  const [zipCode, setZipCode] = useState2(zipProp ?? "");
1045
- const [addressLine1, setAddressLine1] = useState2("");
1046
- const [addressLine2, setAddressLine2] = useState2("");
1047
- const [city, setCity] = useState2("");
1048
- const [stateValue, setStateValue] = useState2("");
1049
+ const [addressLine1, setAddressLine1] = useState2(addressLine1Prop ?? "");
1050
+ const [addressLine2, setAddressLine2] = useState2(addressLine2Prop ?? "");
1051
+ const [city, setCity] = useState2(cityProp ?? "");
1052
+ const [stateValue, setStateValue] = useState2(stateProp ?? "");
1049
1053
  const [accountPatch, setAccountPatch] = useState2({});
1050
1054
  const zipCodeRef = useRef2(zipProp ?? "");
1051
1055
  const selectedCountryRef = useRef2(countryProp ?? "US");
1052
- const addressLine1Ref = useRef2("");
1053
- const addressLine2Ref = useRef2("");
1054
- const cityRef = useRef2("");
1055
- const stateRef = useRef2("");
1056
+ const addressLine1Ref = useRef2(addressLine1Prop ?? "");
1057
+ const addressLine2Ref = useRef2(addressLine2Prop ?? "");
1058
+ const cityRef = useRef2(cityProp ?? "");
1059
+ const stateRef = useRef2(stateProp ?? "");
1056
1060
  const avsConfig = useMemo2(() => resolveAVSConfig(enableAVSProp), [enableAVSProp]);
1057
1061
  const enableAVS = avsConfig !== null;
1058
1062
  const [viewState, setViewState] = useState2(initialCardOpen ? "card" : "buttons");
@@ -3534,6 +3538,10 @@ function FloPayCheckout({
3534
3538
  enableAVS,
3535
3539
  avsLayout,
3536
3540
  country: session?.customer?.country,
3541
+ city: session?.customer?.city,
3542
+ state: session?.customer?.state,
3543
+ addressLine1: session?.customer?.line1,
3544
+ addressLine2: session?.customer?.line2,
3537
3545
  onCountryChange,
3538
3546
  onZipChange,
3539
3547
  avsCheck: !!enableAVS,