@flopay/react 0.4.7 → 0.4.8

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.cjs CHANGED
@@ -1246,9 +1246,22 @@ function SplitCardFormInner({
1246
1246
  }
1247
1247
  setIs3DSActive(true);
1248
1248
  try {
1249
+ const retryBillingAddress = {
1250
+ ...(enableAVS ? selectedCountryRef.current : effectiveAccount.country) ? {
1251
+ country: enableAVS ? selectedCountryRef.current : effectiveAccount.country
1252
+ } : {},
1253
+ ...(enableAVS ? zipCodeRef.current.trim() : effectiveAccount.zip) || "" ? {
1254
+ postal_code: enableAVS ? zipCodeRef.current.trim() : effectiveAccount.zip
1255
+ } : {}
1256
+ };
1249
1257
  const result = await flopay.confirmPayment({
1250
1258
  clientSecret: secret,
1251
- returnUrl: window.location.href
1259
+ returnUrl: window.location.href,
1260
+ billingDetails: {
1261
+ ...effectiveAccount.email ? { email: effectiveAccount.email } : {},
1262
+ ...fullName.trim() ? { name: fullName.trim() } : {},
1263
+ ...Object.keys(retryBillingAddress).length > 0 ? { address: retryBillingAddress } : {}
1264
+ }
1252
1265
  });
1253
1266
  if (result.error) {
1254
1267
  setOverlayStatus("error");
@@ -3495,9 +3508,14 @@ function CheckoutFormInner({
3495
3508
  }
3496
3509
  setIs3DSActive(true);
3497
3510
  try {
3511
+ const retryFullName = `${firstName ?? ""} ${lastName ?? ""}`.trim();
3498
3512
  const result = await flopay.confirmPayment({
3499
3513
  clientSecret: secret,
3500
- returnUrl: window.location.href
3514
+ returnUrl: window.location.href,
3515
+ billingDetails: {
3516
+ ...email ? { email } : {},
3517
+ ...retryFullName ? { name: retryFullName } : {}
3518
+ }
3501
3519
  });
3502
3520
  if (result.error) {
3503
3521
  updateError(result.error.message);