[transfers] Code generation: update services and models - #913
[transfers] Code generation: update services and models#913AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the PHP Transfers SDK by introducing new models and APIs related to cashout operations, default error responses, and interchange data, while renaming the existing Capital API to a deprecated version. It also adds discriminator initialization logic across several models. The review feedback highlights two main issues: first, unconditionally overwriting the type discriminator in constructors (such as in BankAccountV3AccountIdentification, TransferCategoryData, TransferDataTracking, TransferEventEventsDataInner, and TransferEventTrackingData) discards custom values passed during instantiation; second, the validation logic in BankAccountV3AccountIdentification incorrectly requires all polymorphic fields to be non-null, which will cause validation failures for valid single bank account types.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // Initialize discriminator property with the model name. | ||
| $this->container['type'] = static::$openAPIModelName; |
There was a problem hiding this comment.
Unconditionally overwriting $this->container['type'] with static::$openAPIModelName at the end of the constructor discards any custom type value passed via the $data array (e.g., during manual instantiation). It should only initialize the discriminator if it is not already set.
// Initialize discriminator property with the model name if not already set.
if (empty($this->container['type'])) {
$this->container['type'] = static::$openAPIModelName;
}| // Initialize discriminator property with the model name. | ||
| $this->container['type'] = static::$openAPIModelName; |
There was a problem hiding this comment.
Unconditionally overwriting $this->container['type'] with static::$openAPIModelName at the end of the constructor discards any custom type value passed via the $data array (e.g., during manual instantiation). It should only initialize the discriminator if it is not already set.
// Initialize discriminator property with the model name if not already set.
if (empty($this->container['type'])) {
$this->container['type'] = static::$openAPIModelName;
}| // Initialize discriminator property with the model name. | ||
| $this->container['type'] = static::$openAPIModelName; |
There was a problem hiding this comment.
Unconditionally overwriting $this->container['type'] with static::$openAPIModelName at the end of the constructor discards any custom type value passed via the $data array (e.g., during manual instantiation). It should only initialize the discriminator if it is not already set.
// Initialize discriminator property with the model name if not already set.
if (empty($this->container['type'])) {
$this->container['type'] = static::$openAPIModelName;
}| // Initialize discriminator property with the model name. | ||
| $this->container['type'] = static::$openAPIModelName; |
There was a problem hiding this comment.
Unconditionally overwriting $this->container['type'] with static::$openAPIModelName at the end of the constructor discards any custom type value passed via the $data array (e.g., during manual instantiation). It should only initialize the discriminator if it is not already set.
// Initialize discriminator property with the model name if not already set.
if (empty($this->container['type'])) {
$this->container['type'] = static::$openAPIModelName;
}| // Initialize discriminator property with the model name. | ||
| $this->container['type'] = static::$openAPIModelName; |
There was a problem hiding this comment.
Unconditionally overwriting $this->container['type'] with static::$openAPIModelName at the end of the constructor discards any custom type value passed via the $data array (e.g., during manual instantiation). It should only initialize the discriminator if it is not already set.
// Initialize discriminator property with the model name if not already set.
if (empty($this->container['type'])) {
$this->container['type'] = static::$openAPIModelName;
}| if ($this->container['clearingCode'] === null) { | ||
| $invalidProperties[] = "'clearingCode' can't be null"; | ||
| } | ||
| if ($this->container['iban'] === null) { | ||
| $invalidProperties[] = "'iban' can't be null"; | ||
| } | ||
| if ($this->container['bic'] === null) { | ||
| $invalidProperties[] = "'bic' can't be null"; | ||
| } | ||
| if ($this->container['iban'] === null) { | ||
| $invalidProperties[] = "'iban' can't be null"; | ||
| } | ||
| if ($this->container['clearingNumber'] === null) { | ||
| $invalidProperties[] = "'clearingNumber' can't be null"; | ||
| } |
There was a problem hiding this comment.
Since BankAccountV3AccountIdentification is a polymorphic/union model representing different bank account types (such as IBAN, US local, UK local, etc.), requiring all fields (like clearingCode, bic, iban, clearingNumber, sortCode, routingNumber, etc.) to be non-null in listInvalidProperties() makes the validation fail for any valid single bank account type. These fields should be optional or conditionally validated based on the type discriminator.
5c1357b to
02c5d9f
Compare
df42f4b to
04ee774
Compare
3896877 to
74e4566
Compare
b51b7bb to
f404bf0
Compare
c0cccd3 to
a7a34cc
Compare
a7a34cc to
b457b6f
Compare
b457b6f to
1c791e9
Compare
1c791e9 to
b99e78d
Compare
|



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