Skip to content

[management] Code generation: update services and models - #916

Open
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/management
Open

[management] Code generation: update services and models#916
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/management

Conversation

@AdyenAutomationBot

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the management service.

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot
AdyenAutomationBot requested a review from a team as a code owner July 13, 2026 14:26

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 introduces donation campaign management features to the Adyen Management API, adding a new DonationCampaignsApi service and numerous associated models. It also updates existing payment method models to make several properties nullable and adds support for Cash App and DCC split configurations. A critical issue was identified in DonationCampaignsApi.php where the updateDonationCampaignStatus method incorrectly uses CampaignStatusTransition as a type hint for the $status parameter, which will cause runtime TypeErrors since CampaignStatusTransition is a class containing only string constants.

Comment on lines +122 to +132
/**
* Activate or end a donation campaign
*
* @param string $companyId
* @param string $donationCampaignId
* @param CampaignStatusTransition $status
* @param array|null $requestOptions
* @return \Adyen\Model\Management\DonationCampaign
* @throws AdyenException
*/
public function updateDonationCampaignStatus(string $companyId, string $donationCampaignId, CampaignStatusTransition $status, ?array $requestOptions = null): \Adyen\Model\Management\DonationCampaign

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The updateDonationCampaignStatus method signature uses CampaignStatusTransition as a PHP type hint for the $status parameter. However, CampaignStatusTransition is generated as a class containing only constants (representing string enum values like 'activate' and 'end'), rather than an instantiable model or a PHP 8.1 native enum.

This causes multiple critical issues:

  1. Passing a string value (e.g., CampaignStatusTransition::ACTIVATE) will trigger a PHP TypeError because a string is passed where a CampaignStatusTransition instance is expected.
  2. Even if an instance of CampaignStatusTransition were passed, str_replace on line 134 would fail with a TypeError because the class does not implement __toString().
  3. Additionally, CampaignStatusTransition is not imported in this file, so the type hint refers to a non-existent class Adyen\Service\Management\CampaignStatusTransition.

To resolve this, the type hint for $status should be changed to string in both the method signature and the PHPDoc.

    /**
    * Activate or end a donation campaign
    *
    * @param string $companyId
    * @param string $donationCampaignId
    * @param string $status
    * @param array|null $requestOptions
    * @return \Adyen\Model\Management\DonationCampaign
    * @throws AdyenException
    */
    public function updateDonationCampaignStatus(string $companyId, string $donationCampaignId, string $status, ?array $requestOptions = null): \Adyen\Model\Management\DonationCampaign

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 7 times, most recently from ccf08fb to 9a8cb89 Compare July 21, 2026 09:57
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 4 times, most recently from bc24b12 to 7a59d39 Compare July 27, 2026 10:32
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 3 times, most recently from 7da326d to 67e6a53 Compare August 4, 2026 17:19
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 3 times, most recently from 195a2d5 to 7342bcb Compare August 21, 2026 14:04
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from 261ecce to 396ec19 Compare August 27, 2026 14:01
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant