Skip to content

Commit

Permalink
fix: HS:132: card holder name passed as non-empty value (#70)
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 13, 2023
1 parent ea33c10 commit 08d6db8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ let make = (
if !isAllStoredCardsHaveName {
acc->Js.Dict.set(
"payment_method_data.card_token.card_holder_name",
value->Js.Json.string,
value === "" ? Js.Json.null : value->Js.Json.string,
)
}
} else {
Expand Down
10 changes: 8 additions & 2 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ 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.string),
(
"card_holder_name",
cardHolderName === "" ? Js.Json.null : cardHolderName->Js.Json.string,
),
("card_cvc", cvcNumber->Js.Json.string),
("card_issuer", ""->Js.Json.string),
]
Expand Down Expand Up @@ -40,7 +43,10 @@ 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.string),
(
"card_holder_name",
cardHolderName === "" ? Js.Json.null : cardHolderName->Js.Json.string,
),
]
->Js.Dict.fromArray
->Js.Json.object_,
Expand Down

0 comments on commit 08d6db8

Please sign in to comment.