Skip to content

Add Trustly payment method.#16

Merged
rvdsteege merged 4 commits intomainfrom
15-add-trustly-payment-method
Feb 27, 2026
Merged

Add Trustly payment method.#16
rvdsteege merged 4 commits intomainfrom
15-add-trustly-payment-method

Conversation

@rvdsteege
Copy link
Member

Fix #15.

@rvdsteege rvdsteege linked an issue Feb 25, 2026 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 Payment Method: The Trustly payment method has been integrated, expanding the available payment options.
  • Payment Processing Logic: Implemented the necessary logic within the start method to handle Trustly payments, including capturing customer details like first name, last name, country code, and email.

🧠 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
  • src/Gateway.php
    • Registered the new Trustly payment method in the gateway's constructor.
    • Added a case for Trustly in the start method to configure its service parameters for payment processing.
Activity
  • No specific activity (comments, reviews, progress updates) was found in the provided context.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@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 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',

Choose a reason for hiding this comment

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

medium

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,

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Member

@remcotolsma remcotolsma left a comment

Choose a reason for hiding this comment

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

Do the PHP_CodeSniffer, PHPStan and Gemini feedback require attention?

@remcotolsma remcotolsma moved this from Todo to In Progress in Pronamic Pay Feb 27, 2026
@rvdsteege rvdsteege merged commit bb267aa into main Feb 27, 2026
5 of 6 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Pronamic Pay Feb 27, 2026
@rvdsteege rvdsteege deleted the 15-add-trustly-payment-method branch February 27, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Trustly payment method

2 participants