Skip to content

Commit

Permalink
AD-358: Boleto Bancario fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kpieloch committed Dec 10, 2024
1 parent 5feece8 commit d20bcdc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@
.checkout-order-summary .checkout-order-summary-list .thumb svg {
width: 100%;
height: auto;
}

.adyen-checkout__payment-method--boletobancario .adyen-checkout__field--firstName {
display: none;
}

.adyen-checkout__payment-method--boletobancario .adyen-checkout__field--lastName {
display: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class Payment extends React.Component<Props, State> {
locale: this.props.adyenConfig.shopperLocale,
environment: this.castToEnvironment(this.props.adyenConfig.environmentMode),
clientKey: this.props.adyenConfig.adyenClientKey,
countryCode: this.props.adyenConfig.countryCode,
session: {
id: this.props.adyenConfig.sessionData.id,
sessionData: this.props.adyenConfig.sessionData.sessionData
Expand Down Expand Up @@ -150,7 +151,9 @@ class Payment extends React.Component<Props, State> {
this.dropIn = new Dropin(adyenCheckout, {
paymentMethodsConfiguration: {
card: this.getAdyenCardConfig(),
boletoBancarioConfiguration: {
// @ts-ignore
boletobancario: {
// @ts-ignore
personalDetailsRequired: true,
billingAddressRequired: false,
showEmailAddress: false,
Expand All @@ -160,26 +163,6 @@ class Payment extends React.Component<Props, State> {
}
}
},
onSelect: (activeComponent) => {

const observer = new MutationObserver(() => {
const firstNameField = document.querySelector(".adyen-checkout__field--firstName");
const lastNameField = document.querySelector(".adyen-checkout__field--lastName");

if (firstNameField && firstNameField instanceof HTMLElement) {
firstNameField.style.display = "none";
}

if (lastNameField && lastNameField instanceof HTMLElement) {
lastNameField.style.display = "none";
}
});


if (this.paymentRef.current) {
observer.observe(this.paymentRef.current, {childList: true, subtree: true});
}
}
}).mount(this.paymentRef.current);

}
Expand Down

0 comments on commit d20bcdc

Please sign in to comment.