Skip to content

[ECP-9943-V9] Fix installment data loss during GraphQL placeOrder#3292

Merged
shubhamk67 merged 2 commits into
main-9from
ECP-9943-v9
Apr 14, 2026
Merged

[ECP-9943-V9] Fix installment data loss during GraphQL placeOrder#3292
shubhamk67 merged 2 commits into
main-9from
ECP-9943-v9

Conversation

@shubhamk67
Copy link
Copy Markdown
Contributor

Description
This PR fixes an issue in GraphQL headless checkout where the placeOrder mutation re-triggers AdyenCcDataAssignObserver without the original additional payment data, causing fields like number_of_installments to be cleared.

Fixes #2346

@shubhamk67 shubhamk67 requested a review from a team as a code owner April 13, 2026 10:51
@shubhamk67 shubhamk67 added the Fix Indicates a bug fix label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies AdyenCcDataAssignObserver.php to conditionally remove credit card specific fields only when they are present in the incoming request, aiming to prevent data loss during re-triggers like placeOrder. However, the feedback highlights that this conditional logic is redundant as the fields are overwritten later, and the fix is incomplete because AdyenPaymentMethodDataAssignObserver still clears the same fields. Furthermore, the changes cause existing unit tests to fail and leave the BRAND_CODE removal unconditional, which may still result in unintended data loss.

Comment thread Observer/AdyenCcDataAssignObserver.php
@@ -101,9 +101,6 @@ public function execute(Observer $observer)

// Remove the following information from the previous payment
$paymentInfo->unsAdditionalInformation(AdyenPaymentMethodDataAssignObserver::BRAND_CODE);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The removal of BRAND_CODE remains unconditional. If this observer is re-triggered for a non-CC payment method (e.g., during placeOrder), it will wipe out the brand_code set by other observers. To fully prevent data loss during re-triggers, this removal should also be made conditional on whether the current request is actually providing CC data, or moved after the $additionalData check.

shanikantsingh
shanikantsingh previously approved these changes Apr 13, 2026
amihajlovski
amihajlovski previously approved these changes Apr 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

@shubhamk67 shubhamk67 merged commit 1abc1cf into main-9 Apr 14, 2026
10 of 11 checks passed
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.

3 participants