Skip to content

Commit

Permalink
fix:HS-132: Added card token object for saved cards (#79)
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 21, 2023
1 parent 729bf3c commit 77eaa7a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -425,22 +425,21 @@ let make = (
acc->Js.Dict.set("billing.address.zip", postalCode.value->Js.Json.string)
| _ => ()
}
// if (
// isSavedCardFlow &&
// (item.field_type === BillingName || item.field_type === FullName) &&
// item.display_name === "card_holder_name" &&
// item.required_field === "payment_method_data.card.card_holder_name"
// ) {
// if !isAllStoredCardsHaveName {
// acc->Js.Dict.set(
// "payment_method_data.card_token.card_holder_name",
// value->Js.Json.string,
// )
// }
// } else {
// acc->Js.Dict.set(item.required_field, value->Js.Json.string)
// }
acc->Js.Dict.set(item.required_field, value->Js.Json.string)
if (
isSavedCardFlow &&
(item.field_type === BillingName || item.field_type === FullName) &&
item.display_name === "card_holder_name" &&
item.required_field === "payment_method_data.card.card_holder_name"
) {
if !isAllStoredCardsHaveName {
acc->Js.Dict.set(
"payment_method_data.card_token.card_holder_name",
value->Js.Json.string,
)
}
} else {
acc->Js.Dict.set(item.required_field, value->Js.Json.string)
}
acc
}, Js.Dict.empty())

Expand Down

0 comments on commit 77eaa7a

Please sign in to comment.