[ECP-9904] Stop setting cc_type in payment additional_information#3264
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors how credit card type ( Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors how cc_type is handled by no longer storing it in the payment's additional_information and instead using the dedicated cc_type property on the payment object. This is a good improvement for code clarity and correctness. The changes are consistently applied across various observers and response handlers.
Additionally, the Magento edition is now included in the platform information sent to Adyen, which is a helpful enhancement.
I've suggested a minor improvement in two files to make the string concatenation for the platform name more robust, preventing potential trailing spaces if the edition is empty.
I am having trouble creating individual review comments. Click here to see my feedback.
Helper/Data.php (464-465)
While concatenating the platform name and edition is a good improvement, this implementation could result in a trailing space if edition is empty or null. A more robust way to handle this would be to filter out empty parts before joining them.
$platformName = implode(' ', array_filter([$platformData['name'], $platformData['edition'] ?? null]));
$client->setExternalPlatform($platformName, $platformData['version'], $platformIntegrator);Helper/PointOfSale.php (73)
Similar to the change in Helper/Data.php, this concatenation could result in a trailing space if getEdition() returns an empty string. It's better to filter out empty parts before joining.
[ApplicationInfo::NAME] = implode(' ', array_filter([$this->productMetadata->getName(), $this->productMetadata->getEdition()]));
|



Description
With this refactoring, the plugin now sets card type only on
cc_typefield ofsales_order_paymenttable but not on theadditional_information.