diff --git a/composer.json b/composer.json index f91b33a..96d7010 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "adyen/adyen-magento2-expresscheckout", "description": "Official Adyen Magento2 plugin to add express payment method shortcuts.", "type": "magento2-module", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "repositories": [ { diff --git a/etc/module.xml b/etc/module.xml index 77d3477..437f44b 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -11,7 +11,7 @@ */ --> - + diff --git a/view/frontend/web/js/googlepay/button.js b/view/frontend/web/js/googlepay/button.js index cc19c9c..49138e0 100644 --- a/view/frontend/web/js/googlepay/button.js +++ b/view/frontend/web/js/googlepay/button.js @@ -280,7 +280,15 @@ define([ activateCart(this.isProductView) .then(() => getShippingMethods(payload, this.isProductView)) .then(function (response) { - // Stop if no shipping methods. + + // If the shipping_method is not available, remove it from the response array. + for (let key in response) { + if (response[key].available === false) { + response.splice(key, 1); + } + } + + // Stop if no shipping methods. if (response.length === 0) { reject($t('There are no shipping methods available for you right now. Please try again or use an alternative payment method.')); return;