From c11b32b03ae6d7bcc4aeb8dabbc9eb456bfbb4b3 Mon Sep 17 00:00:00 2001 From: Arun Mishra <68141066+arun-mi@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:49:11 +0530 Subject: [PATCH] fix: HS:132: reverting changes for cardholder name (#74) Co-authored-by: arun.mishra --- src/Components/DynamicFields.res | 7 ++++--- src/Utilities/PaymentBody.res | 10 ++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index 39dd32404..d92ec1781 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -313,7 +313,7 @@ let make = ( setFields(setEmail, email, requiredField, false) if emailValue === "" { let newEmail: RecoilAtomTypes.field = { - value: value, + value, isValid: None, errorString: "", } @@ -437,7 +437,7 @@ let make = ( if !isAllStoredCardsHaveName { acc->Js.Dict.set( "payment_method_data.card_token.card_holder_name", - value === "" ? Js.Json.null : value->Js.Json.string, + value->Js.Json.string, ) } } else { @@ -676,7 +676,8 @@ let make = ( options=bankNames /> | SpecialField(element) => element - | InfoElement => <> + | InfoElement => + <> {if fieldsArr->Js.Array2.length > 1 { bottomElement diff --git a/src/Utilities/PaymentBody.res b/src/Utilities/PaymentBody.res index fee55f32a..46dd4bad3 100644 --- a/src/Utilities/PaymentBody.res +++ b/src/Utilities/PaymentBody.res @@ -11,10 +11,7 @@ let cardPaymentBody = (~cardNumber, ~month, ~year, ~cardHolderName, ~cvcNumber, ("card_number", cardNumber->CardUtils.clearSpaces->Js.Json.string), ("card_exp_month", month->Js.Json.string), ("card_exp_year", year->Js.Json.string), - ( - "card_holder_name", - cardHolderName === "" ? Js.Json.null : cardHolderName->Js.Json.string, - ), + ("card_holder_name", cardHolderName->Js.Json.string), ("card_cvc", cvcNumber->Js.Json.string), ("card_issuer", ""->Js.Json.string), ] @@ -43,10 +40,7 @@ let bancontactBody = (~cardNumber, ~month, ~year, ~cardHolderName) => [ ("card_number", cardNumber->CardUtils.clearSpaces->Js.Json.string), ("card_exp_month", month->Js.Json.string), ("card_exp_year", year->Js.Json.string), - ( - "card_holder_name", - cardHolderName === "" ? Js.Json.null : cardHolderName->Js.Json.string, - ), + ("card_holder_name", cardHolderName->Js.Json.string), ] ->Js.Dict.fromArray ->Js.Json.object_,