Skip to content

Commit

Permalink
fix: HS:132: reverting changes for cardholder name (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: arun.mishra <[email protected]>
  • Loading branch information
arun-mi and arun.mishra authored Dec 20, 2023
1 parent 58bba25 commit c11b32b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ let make = (
setFields(setEmail, email, requiredField, false)
if emailValue === "" {
let newEmail: RecoilAtomTypes.field = {
value: value,
value,
isValid: None,
errorString: "",
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -676,7 +676,8 @@ let make = (
options=bankNames
/>
| SpecialField(element) => element
| InfoElement => <>
| InfoElement =>
<>
<Surcharge list paymentMethod paymentMethodType />
{if fieldsArr->Js.Array2.length > 1 {
bottomElement
Expand Down
10 changes: 2 additions & 8 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
Expand Down Expand Up @@ -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_,
Expand Down

0 comments on commit c11b32b

Please sign in to comment.