Skip to content

Commit

Permalink
feat: hideCardNicknameField added (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Jun 14, 2024
1 parent 6e86d4a commit 36109ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ let make = (
/>
</div>
</RenderIf>
<RenderIf condition={isCustomerAcceptanceRequired}>
<RenderIf condition={!options.hideCardNicknameField && isCustomerAcceptanceRequired}>
<div className={`pb-2 ${nicknameFieldClassName}`}>
<NicknamePaymentInput paymentType value=nickname setValue=setNickname />
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/Types/PaymentType.res
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ type options = {
savedPaymentMethodsHeaderText?: string,
hideExpiredPaymentMethods: bool,
displayDefaultSavedPaymentIcon: bool,
hideCardNicknameField: bool,
}
let defaultCardDetails = {
scheme: None,
Expand Down Expand Up @@ -299,6 +300,7 @@ let defaultOptions = {
sdkHandleConfirmPayment: defaultSdkHandleConfirmPayment,
hideExpiredPaymentMethods: false,
displayDefaultSavedPaymentIcon: true,
hideCardNicknameField: false,
}
let getLayout = (str, logger) => {
switch str {
Expand Down Expand Up @@ -986,6 +988,7 @@ let itemToObjMapper = (dict, logger) => {
"hideExpiredPaymentMethods",
"branding",
"displayDefaultSavedPaymentIcon",
"hideCardNicknameField",
],
dict,
"options",
Expand Down Expand Up @@ -1028,6 +1031,7 @@ let itemToObjMapper = (dict, logger) => {
savedPaymentMethodsHeaderText: ?getOptionString(dict, "savedPaymentMethodsHeaderText"),
hideExpiredPaymentMethods: getBool(dict, "hideExpiredPaymentMethods", false),
displayDefaultSavedPaymentIcon: getBool(dict, "displayDefaultSavedPaymentIcon", true),
hideCardNicknameField: getBool(dict, "hideCardNicknameField", false),
}
}

Expand Down

0 comments on commit 36109ca

Please sign in to comment.