@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.mjs CHANGED
@@ -1200,9 +1200,22 @@ function SplitCardFormInner({
1200
1200
  }
1201
1201
  setIs3DSActive(true);
1202
1202
  try {
1203
+ const retryBillingAddress = {
1204
+ ...(enableAVS ? selectedCountryRef.current : effectiveAccount.country) ? {
1205
+ country: enableAVS ? selectedCountryRef.current : effectiveAccount.country
1206
+ } : {},
1207
+ ...(enableAVS ? zipCodeRef.current.trim() : effectiveAccount.zip) || "" ? {
1208
+ postal_code: enableAVS ? zipCodeRef.current.trim() : effectiveAccount.zip
1209
+ } : {}
1210
+ };
1203
1211
  const result = await flopay.confirmPayment({
1204
1212
  clientSecret: secret,
1205
- returnUrl: window.location.href
1213
+ returnUrl: window.location.href,
1214
+ billingDetails: {
1215
+ ...effectiveAccount.email ? { email: effectiveAccount.email } : {},
1216
+ ...fullName.trim() ? { name: fullName.trim() } : {},
1217
+ ...Object.keys(retryBillingAddress).length > 0 ? { address: retryBillingAddress } : {}
1218
+ }
1206
1219
  });
1207
1220
  if (result.error) {
1208
1221
  setOverlayStatus("error");
@@ -3449,9 +3462,14 @@ function CheckoutFormInner({
3449
3462
  }
3450
3463
  setIs3DSActive(true);
3451
3464
  try {
3465
+ const retryFullName = `${firstName ?? ""} ${lastName ?? ""}`.trim();
3452
3466
  const result = await flopay.confirmPayment({
3453
3467
  clientSecret: secret,
3454
- returnUrl: window.location.href
3468
+ returnUrl: window.location.href,
3469
+ billingDetails: {
3470
+ ...email ? { email } : {},
3471
+ ...retryFullName ? { name: retryFullName } : {}
3472
+ }
3455
3473
  });
3456
3474
  if (result.error) {
3457
3475
  updateError(result.error.message);