From 28256d3be0ae872016f58f0b470467d5e7486e83 Mon Sep 17 00:00:00 2001 From: Rakhal Imming Date: Tue, 13 Feb 2024 09:19:05 +0100 Subject: [PATCH 1/2] Fixes issue with the place order button is disabled after re-render of payment component --- .../web/js/view/payment/method-renderer/adyen-pm-method.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js index b97226d77..fb1755e52 100755 --- a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js @@ -181,7 +181,7 @@ define( }, renderCheckoutComponent: function() { - this.isPlaceOrderAllowed(false); + this.isPlaceOrderAllowed(quote.billingAddress() != null); let configuration = this.buildComponentConfiguration(this.paymentMethod(), this.paymentMethodsExtraInfo()); this.mountPaymentMethodComponent(this.paymentMethod(), configuration); From 5bf501f8c98fa6f0d5b750db99e2080d8f5bdaa0 Mon Sep 17 00:00:00 2001 From: Rakhal Imming Date: Mon, 26 Feb 2024 15:16:54 +0100 Subject: [PATCH 2/2] Processed feedback --- .../method-renderer/adyen-pm-method.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js index fb1755e52..e646ce335 100755 --- a/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/adyen-pm-method.js @@ -181,10 +181,17 @@ define( }, renderCheckoutComponent: function() { - this.isPlaceOrderAllowed(quote.billingAddress() != null); - let configuration = this.buildComponentConfiguration(this.paymentMethod(), this.paymentMethodsExtraInfo()); - - this.mountPaymentMethodComponent(this.paymentMethod(), configuration); + this.isPlaceOrderAllowed(false); + const configuration = this.buildComponentConfiguration( + this.paymentMethod(), + this.paymentMethodsExtraInfo() + ); + this.mountPaymentMethodComponent(this.paymentMethod(), configuration).then( + function() { + const hasBillingAddress = quote.billingAddress() !== null + this.isPlaceOrderAllowed(hasBillingAddress); + } + ); }, buildComponentConfiguration: function (paymentMethod, paymentMethodsExtraInfo) { @@ -222,14 +229,14 @@ define( return this.item.method; }, - mountPaymentMethodComponent(paymentMethod, configuration) + mountPaymentMethodComponent: async function(paymentMethod, configuration) { let self = this; try { const containerId = '#' + paymentMethod.type + 'Container'; - this.paymentComponent = adyenCheckout.mountPaymentMethodComponent( + this.paymentComponent = await adyenCheckout.mountPaymentMethodComponent( self.checkoutComponent, self.getTxVariant(), configuration,