diff --git a/src/Payments/PaymentMethodsRecord.res b/src/Payments/PaymentMethodsRecord.res index e0da60f2b..6295b4be3 100644 --- a/src/Payments/PaymentMethodsRecord.res +++ b/src/Payments/PaymentMethodsRecord.res @@ -528,17 +528,31 @@ let getRequiredFieldsFromJson = dict => { let dynamicFieldsEnabledPaymentMethods = ["crypto_currency", "debit", "credit", "blik"] -let getPaymentMethodFields = (paymentMethod, requiredFields, ~isSavedCardFlow=false, ~isAllStoredCardsHaveName=false, ()) => { +let getPaymentMethodFields = ( + paymentMethod, + requiredFields, + ~isSavedCardFlow=false, + ~isAllStoredCardsHaveName=false, + (), +) => { let requiredFieldsArr = requiredFields ->Utils.getDictFromJson ->Js.Dict.values ->Js.Array2.map(item => { - let val = item->Utils.getDictFromJson->getRequiredFieldsFromJson - if isSavedCardFlow && val.display_name === "card_holder_name" && isAllStoredCardsHaveName { - None + let requiredField = item->Utils.getDictFromJson->getRequiredFieldsFromJson + if requiredField.value === "" { + if ( + isSavedCardFlow && + requiredField.display_name === "card_holder_name" && + isAllStoredCardsHaveName + ) { + None + } else { + requiredField.field_type + } } else { - val.field_type + None } }) requiredFieldsArr->Js.Array2.concat(