Skip to content

[EPC-9586] Fix card form validation after payment method switching#2943

Merged
candemiralp merged 3 commits intomainfrom
ECP-9586
Apr 30, 2025
Merged

[EPC-9586] Fix card form validation after payment method switching#2943
candemiralp merged 3 commits intomainfrom
ECP-9586

Conversation

@candemiralp
Copy link
Contributor

Description

The card component mount function is triggered again after re-selecting card payment method even though the card component is mounted in the first attempt. This action invalidates the isValid property of the card component and validate() function fails. Therefore, Place Order button stays deactivated. This PR checks the existences of the card component before triggering mount action.

Besides this issue, multishipping card payment has a similar issue in which stateData input field couldn't be populated again after re-selecting the card payment method. This issue occurs as the stateData is only assigned on onChange event callback. However, while switching the payment method, onChange callback is not triggered. This PR also addresses this issue in the multipshipping method renderer.

While handling this issue, more tests have been performed on alternative payment method with forms (SEPA Direct Debit etc.) and no issues have been observed.

Tested scenarios

  • Switching the payment method after filling out the card form

Fixes #2898

@sonarqubecloud
Copy link

@candemiralp candemiralp merged commit d26fb85 into main Apr 30, 2025
14 of 15 checks passed
@candemiralp candemiralp deleted the ECP-9586 branch April 30, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Indicates a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ECP-9635]Cannot place order when switching between payment methods

3 participants