Skip to content

Commit

Permalink
Merge pull request #2809 from Adyen/ECP-9493
Browse files Browse the repository at this point in the history
[ECP-9493]ApplePay and GooglePay -Terms & Conditions checkbox validation
  • Loading branch information
khushboo-singhvi authored Nov 25, 2024
2 parents 18e2968 + 9a62bb7 commit 0431f3b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Model/Ui/AdyenGenericConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ protected function showLogos(): bool
}
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@ define(
},
buildComponentConfiguration: function (paymentMethod, paymentMethodsExtraInfo) {
let baseComponentConfiguration = this._super();
let self = this;
let applePayConfiguration = Object.assign(baseComponentConfiguration,
{
showPayButton: true,
totalPriceLabel: baseComponentConfiguration.configuration.merchantName,
amount: paymentMethodsExtraInfo[paymentMethod.type].configuration.amount
}
);
applePayConfiguration.onClick = function(resolve, reject) {
if (self.validate()) {
resolve();
} else {
reject();
}
}

return applePayConfiguration;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ define(
'Magento_Checkout/js/model/quote',
'Adyen_Payment/js/view/payment/method-renderer/adyen-pm-method',
],
function(
function (
quote,
adyenPaymentMethod,
adyenPaymentMethod
) {
return adyenPaymentMethod.extend({
placeOrderButtonVisible: false,
Expand All @@ -23,12 +23,23 @@ define(
},
buildComponentConfiguration: function (paymentMethod, paymentMethodsExtraInfo) {
let baseComponentConfiguration = this._super();
let self = this;
let googlePayConfiguration = Object.assign(
baseComponentConfiguration,
paymentMethodsExtraInfo[paymentMethod.type].configuration
);

let googlePayConfiguration = Object.assign(baseComponentConfiguration, paymentMethodsExtraInfo[paymentMethod.type].configuration);
googlePayConfiguration.showPayButton = true;

return googlePayConfiguration
googlePayConfiguration.onClick = function(resolve,reject) {
if (self.validate()) {
resolve();
} else {
reject();
}
}
return googlePayConfiguration;
}
})
});
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ define(
},

handleOnFailure: function(error, component) {
this.isPlaceOrderAllowed(true);

paymentComponentStates().setIsPlaceOrderAllowed(this.getMethodCode(), true);

fullScreenLoader.stopLoader();
errorProcessor.process(error, this.currentMessageContainer);
},
Expand Down

0 comments on commit 0431f3b

Please sign in to comment.