Conversation
Summary of ChangesHello @rvdsteege, 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 introduces the Trustly payment method, enhancing the gateway's capabilities by providing users with an additional secure and convenient way to process transactions. The integration includes both the registration of the new method and the implementation of its specific processing requirements. 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
Activity
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 adds support for the Trustly payment method. The implementation is mostly correct, but I've found a potential critical issue with null-safety that could lead to fatal errors, and a minor issue regarding code consistency and maintainability. Please see my comments for details and suggestions.
src/Gateway.php
Outdated
| case Core_PaymentMethods::TRUSTLY: | ||
| $data->Services->ServiceList[] = (object) [ | ||
| 'Action' => 'Pay', | ||
| 'Name' => 'Trustly', |
There was a problem hiding this comment.
The payment method name 'Trustly' is hardcoded. For consistency with other payment methods and improved maintainability, it's better to define this as a constant in the PaymentMethods class and add it to the payment method map in src/PaymentMethods.php. This makes the code easier to manage and less prone to typos.
For example, you could add const TRUSTLY = 'Trustly'; to PaymentMethods and then use PaymentMethods::TRUSTLY here.
'Name' => PaymentMethods::TRUSTLY,There was a problem hiding this comment.
The Buckaroo documentation (https://docs.buckaroo.io/docs/trustly-requests) uses Trustly for the service name. Our PaymentMethods::TRUSTLY constant is lower-case (trustly).
Since other payment methods follow the casing used in the Buckaroo documentation, using the constant here would be inconsistent.
remcotolsma
left a comment
There was a problem hiding this comment.
Do the PHP_CodeSniffer, PHPStan and Gemini feedback require attention?
…ss\Pay\Payments\Payment`.
Fix #15.