Adyen / adyen-magento2-express-checkout

Adyen Magento 2 Express Checkout Module
MIT License
11 stars 6 forks source link

[ECP-8770-v1] Fix shipping method parsing error #71

Closed candemiralp closed 10 months ago

candemiralp commented 10 months ago

Summary

Adobe Commerce provides the opportunity to show the shopping method even though it's not available for the given card. This behaviour can be applied by setting the value of Configuration / Sales / Shipping Method / Free Shipping / Show Method if Not Applicable config field to Yes.

Even though the shipping method is transferred to the frontend, method_code of this shipping method will be empty. This triggers the issue of undefined method_code.

This PR solves this issue by unsetting the shipping method if it's not available just by checking the value of available property.

Tested scenarios

sonarcloud[bot] commented 10 months ago

Quality Gate Failed Quality Gate failed

Failed conditions

B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint