[ECP-9943-V9] Fix installment data loss during GraphQL placeOrder#3292
Conversation
There was a problem hiding this comment.
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.
| @@ -101,9 +101,6 @@ public function execute(Observer $observer) | |||
|
|
|||
| // Remove the following information from the previous payment | |||
| $paymentInfo->unsAdditionalInformation(AdyenPaymentMethodDataAssignObserver::BRAND_CODE); | |||
There was a problem hiding this comment.
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.
dc76ffa
|



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