-
Notifications
You must be signed in to change notification settings - Fork 116
[ManagementAPIs] Code generation: update services and models #792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f02d7ee to
2113c99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @AdyenAutomationBot, 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 is an automated update to the Management APIs client library, synchronizing it with the latest OpenAPI specification. The changes primarily introduce support for new payment methods and sub-merchant data, alongside minor code generation refinements and API contract clarifications.
Highlights
- New Payment Method Support: Added the
AlipayPlusInfomodel and integrated it into thePaymentMethodandPaymentMethodSetupInfomodels, enabling support for Alipay Plus. - Expanded Payment Method Types: Introduced numerous new payment method type constants across
PaymentMethodResponseandPaymentMethodSetupInfo(e.g.,AVANCARD,COOPER,GREEN_CARD,LE_CARD,MAESTRO_USA,MAXIFROTA,MEGALEVE,NUTRICASH,PERSONAL_CARD,SENFF,UP_BRAZIL,VEGAS_CARD,VERO_CARD), reflecting an expanded range of supported payment options. - Sub-Merchant Data Integration: Introduced a new
SubMerchantDatamodel and integrated it intoStoreand related request/update models, allowing for the association of sub-merchant details (email, ID, MCC, name) with stores. - API Contract Clarification: Updated the
Keymodel'spassphrasedocumentation to provide explicit security requirements for the secure passphrase. - Code Generation Refinements: Applied minor formatting adjustments and removed
SplFileObjectdeserialization logic inObjectSerializerclasses across both Balance Control and Management API models.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 or fill out our survey to provide feedback.
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
-
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. ↩
There was a problem hiding this 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 updates models and services based on OpenAPI spec changes. The changes mostly involve adding new models like AlipayPlusInfo and SubMerchantData, and new properties and payment method types to existing models.
I've found a few issues:
- A critical issue in
src/Adyen/Model/Management/ObjectSerializer.phpwhere deserialization forSplFileObjectmight be broken. - Several style violations against PSR-12 in
ObjectSerializer.phpfiles, such as incorrect spacing forforeachand use of single-lineifs without braces. - Minor style issues like unnecessary whitespace and poorly formatted PHPDoc comments in various files.
The review comments reference PSR-12 where applicable.
| } | ||
|
|
||
| /** @psalm-suppress ParadoxicalCondition */ | ||
| if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the \SplFileObject deserialization logic has introduced a bug. The class \SplFileObject is still present in this in_array check, which will cause settype($data, '\SplFileObject') to be called. The settype function does not support class names and will not work as expected, likely causing a runtime error.
If \SplFileObject is no longer supported for deserialization, it should also be removed from this in_array check. If it is still supported, the deserialization logic should be restored.
if (in_array($class, ['\DateTime', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {| * @param string $originId | ||
| * @param array|null $requestOptions | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @param string $originId | ||
| * @param array|null $requestOptions | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| } else { | ||
| foreach ($data as $property => $value) { | ||
| foreach($data as $property => $value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change violates the PSR-12 coding standard, which requires a space after control structure keywords1. Please add a space between foreach and the opening parenthesis.
foreach ($data as $property => $value) {Style Guide References
Footnotes
| if (!is_string($timestamp)) { | ||
| return $timestamp; | ||
| } | ||
| if (!is_string($timestamp)) return $timestamp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change to a single-line if statement is against PSR-12 recommendations, which state that the body of each structure MUST be enclosed in braces1. This improves readability and reduces the likelihood of introducing errors when adding new lines. Please revert to using braces.
if (!is_string($timestamp)) {
return $timestamp;
}Style Guide References
Footnotes
| { | ||
| $endpoint = $this->baseURL . str_replace(['{merchantId}', '{paymentMethodId}'], [$merchantId, $paymentMethodId], "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"); | ||
| $this->requestHttp($endpoint, strtolower('POST'), (array) $applePayInfo->jsonSerialize(), $requestOptions); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| $endpoint = $this->baseURL . str_replace(['{merchantId}', '{payoutSettingsId}'], [$merchantId, $payoutSettingsId], "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); | ||
| $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| $endpoint = $this->baseURL . str_replace(['{terminalId}'], [$terminalId], "/terminals/{terminalId}/reassign"); | ||
| $this->requestHttp($endpoint, strtolower('POST'), (array) $terminalReassignmentRequest->jsonSerialize(), $requestOptions); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| $endpoint = $this->baseURL . str_replace(['{companyId}', '{webhookId}'], [$companyId, $webhookId], "/companies/{companyId}/webhooks/{webhookId}"); | ||
| $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| { | ||
| $endpoint = $this->baseURL . str_replace(['{merchantId}', '{webhookId}'], [$merchantId, $webhookId], "/merchants/{merchantId}/webhooks/{webhookId}"); | ||
| $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9112bf2 to
a6332f7
Compare
|



OpenAPI spec files or templates have been modified on 06-08-2025 by commit.
Management API
AlipayPlusandMaestroUsapayment methods: seePaymentMethodandPaymentMethodSetupInfoclassesPaymentMethodResponse,PaymentMethodSetupInfoandUpdatePaymentMethodInfoseveralTypesWithErrorsEnumenums have been added (alipay_plus,avancard,cooper, etc..Store,StoreCreationRequest,UpdateStoreRequestandStoreCreationWithMerchantCodeRequestadd attributesubMerchantData