[management] Code generation: update services and models - #916
[management] Code generation: update services and models#916AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
| /** | ||
| * 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 |
There was a problem hiding this comment.
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:
- Passing a string value (e.g.,
CampaignStatusTransition::ACTIVATE) will trigger a PHPTypeErrorbecause a string is passed where aCampaignStatusTransitioninstance is expected. - Even if an instance of
CampaignStatusTransitionwere passed,str_replaceon line 134 would fail with aTypeErrorbecause the class does not implement__toString(). - Additionally,
CampaignStatusTransitionis not imported in this file, so the type hint refers to a non-existent classAdyen\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\DonationCampaignccf08fb to
9a8cb89
Compare
bc24b12 to
7a59d39
Compare
7da326d to
67e6a53
Compare
195a2d5 to
7342bcb
Compare
261ecce to
396ec19
Compare
396ec19 to
c6da531
Compare
|



This PR contains the automated changes for the
managementservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.