Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/AccelInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ public function setProcessingType($processingType)
{
$allowedValues = $this->getProcessingTypeAllowableValues();
if (!in_array($processingType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'processingType', must be one of '%s'",
"processingType: unexpected enum value '%s' - Supported values are [%s]",
$processingType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +332 to 338
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "processingType: unexpected enum value '%s' - Supported values are [%s]",
                    $processingType,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down
2 changes: 1 addition & 1 deletion src/Adyen/Model/Management/AdditionalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function getProperties()
/**
* Sets properties
*
* @param array<string,bool>|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured.
* @param array<string,bool>|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `includeCaptureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured.
*
* @return self
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function getProperties()
/**
* Sets properties
*
* @param array<string,bool>|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `captureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured.
* @param array<string,bool>|null $properties Object containing boolean key-value pairs. The key can be any [standard webhook additional setting](https://docs.adyen.com/development-resources/webhooks/additional-settings), and the value indicates if the setting is enabled. For example, `includeCaptureDelayHours`: **true** means the standard notifications you get will contain the number of hours remaining until the payment will be captured.
*
* @return self
*/
Expand Down
66 changes: 66 additions & 0 deletions src/Adyen/Model/Management/AffirmInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class AffirmInfo implements ModelInterface, ArrayAccess, \JsonSerializable
* @var string[]
*/
protected static $openAPITypes = [
'pricePlan' => 'string',
'supportEmail' => 'string'
];

Expand All @@ -52,6 +53,7 @@ class AffirmInfo implements ModelInterface, ArrayAccess, \JsonSerializable
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'pricePlan' => null,
'supportEmail' => null
];

Expand All @@ -61,6 +63,7 @@ class AffirmInfo implements ModelInterface, ArrayAccess, \JsonSerializable
* @var boolean[]
*/
protected static $openAPINullables = [
'pricePlan' => false,
'supportEmail' => false
];

Expand Down Expand Up @@ -150,6 +153,7 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $attributeMap = [
'pricePlan' => 'pricePlan',
'supportEmail' => 'supportEmail'
];

Expand All @@ -159,6 +163,7 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $setters = [
'pricePlan' => 'setPricePlan',
'supportEmail' => 'setSupportEmail'
];

Expand All @@ -168,6 +173,7 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $getters = [
'pricePlan' => 'getPricePlan',
'supportEmail' => 'getSupportEmail'
];

Expand Down Expand Up @@ -212,7 +218,23 @@ public function getModelName()
return self::$openAPIModelName;
}

public const PRICE_PLAN_BRONZE = 'BRONZE';
public const PRICE_PLAN_SILVER = 'SILVER';
public const PRICE_PLAN_GOLD = 'GOLD';

/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getPricePlanAllowableValues()
{
return [
self::PRICE_PLAN_BRONZE,
self::PRICE_PLAN_SILVER,
self::PRICE_PLAN_GOLD,
];
}
/**
* Associative array for storing property values
*
Expand All @@ -228,6 +250,7 @@ public function getModelName()
*/
public function __construct(?array $data = null)
{
$this->setIfExists('pricePlan', $data ?? [], null);
$this->setIfExists('supportEmail', $data ?? [], null);
}

Expand Down Expand Up @@ -258,6 +281,15 @@ public function listInvalidProperties()
{
$invalidProperties = [];

$allowedValues = $this->getPricePlanAllowableValues();
if (!is_null($this->container['pricePlan']) && !in_array($this->container['pricePlan'], $allowedValues, true)) {
$invalidProperties[] = sprintf(
"invalid value '%s' for 'pricePlan', must be one of '%s'",
$this->container['pricePlan'],
implode("', '", $allowedValues)
);
}

if ($this->container['supportEmail'] === null) {
$invalidProperties[] = "'supportEmail' can't be null";
}
Expand All @@ -276,6 +308,40 @@ public function valid()
}


/**
* Gets pricePlan
*
* @return string|null
*/
public function getPricePlan()
{
return $this->container['pricePlan'];
}

/**
* Sets pricePlan
*
* @param string|null $pricePlan Merchant price plan
*
* @return self
*/
public function setPricePlan($pricePlan)
{
$allowedValues = $this->getPricePlanAllowableValues();
if (!in_array($pricePlan, $allowedValues, true)) {
error_log(
sprintf(
"pricePlan: unexpected enum value '%s' - Supported values are [%s]",
$pricePlan,
implode(', ', $allowedValues)
)
);
Comment on lines +332 to +338
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "pricePlan: unexpected enum value '%s' - Supported values are [%s]",
                    $pricePlan,
                    implode(', ', $allowedValues)
                )
            );

}
$this->container['pricePlan'] = $pricePlan;

return $this;
}

/**
* Gets supportEmail
*
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/AmexInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ public function setServiceLevel($serviceLevel)
{
$allowedValues = $this->getServiceLevelAllowableValues();
if (!in_array($serviceLevel, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'serviceLevel', must be one of '%s'",
"serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
$serviceLevel,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +387 to 393
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
                    $serviceLevel,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down
4 changes: 2 additions & 2 deletions src/Adyen/Model/Management/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function getCurrency()
/**
* Sets currency
*
* @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
* @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount.
*
* @return self
*/
Expand All @@ -323,7 +323,7 @@ public function getValue()
/**
* Sets value
*
* @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
* @param int $value The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
*
* @return self
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/AndroidApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ public function setStatus($status)
{
$allowedValues = $this->getStatusAllowableValues();
if (!in_array($status, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'status', must be one of '%s'",
"status: unexpected enum value '%s' - Supported values are [%s]",
$status,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +534 to 540
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "status: unexpected enum value '%s' - Supported values are [%s]",
                    $status,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down
2 changes: 1 addition & 1 deletion src/Adyen/Model/Management/CardholderReceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function getHeaderForAuthorizedReceipt()
/**
* Sets headerForAuthorizedReceipt
*
* @param string|null $headerForAuthorizedReceipt A custom header to show on the shopper receipt for an authorised transaction. Allows one or two comma-separated header lines, and blank lines. For example, `header,header,filler`
* @param string|null $headerForAuthorizedReceipt The structure of the header to show on the shopper receipt. You can define the order of one or two header lines and blank lines. For example, **header1,header2,filler**. The text of the header lines is defined in the Customer Area under **In-person payments** > **Terminal settings** > **Receipts** in the **Receipt lines** block.
*
* @return self
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/Connectivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ public function setSimcardStatus($simcardStatus)
{
$allowedValues = $this->getSimcardStatusAllowableValues();
if (!in_array($simcardStatus, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'simcardStatus', must be one of '%s'",
"simcardStatus: unexpected enum value '%s' - Supported values are [%s]",
$simcardStatus,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +327 to 333
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "simcardStatus: unexpected enum value '%s' - Supported values are [%s]",
                    $simcardStatus,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down
24 changes: 12 additions & 12 deletions src/Adyen/Model/Management/CreateCompanyWebhookRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,11 @@ public function setCommunicationFormat($communicationFormat)
{
$allowedValues = $this->getCommunicationFormatAllowableValues();
if (!in_array($communicationFormat, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'communicationFormat', must be one of '%s'",
"communicationFormat: unexpected enum value '%s' - Supported values are [%s]",
$communicationFormat,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +638 to 644
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "communicationFormat: unexpected enum value '%s' - Supported values are [%s]",
                    $communicationFormat,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down Expand Up @@ -693,11 +693,11 @@ public function setEncryptionProtocol($encryptionProtocol)
{
$allowedValues = $this->getEncryptionProtocolAllowableValues();
if (!in_array($encryptionProtocol, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'encryptionProtocol', must be one of '%s'",
"encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]",
$encryptionProtocol,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -727,11 +727,11 @@ public function setFilterMerchantAccountType($filterMerchantAccountType)
{
$allowedValues = $this->getFilterMerchantAccountTypeAllowableValues();
if (!in_array($filterMerchantAccountType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'filterMerchantAccountType', must be one of '%s'",
"filterMerchantAccountType: unexpected enum value '%s' - Supported values are [%s]",
$filterMerchantAccountType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -785,11 +785,11 @@ public function setNetworkType($networkType)
{
$allowedValues = $this->getNetworkTypeAllowableValues();
if (!in_array($networkType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'networkType', must be one of '%s'",
"networkType: unexpected enum value '%s' - Supported values are [%s]",
$networkType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
18 changes: 9 additions & 9 deletions src/Adyen/Model/Management/CreateMerchantWebhookRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,11 @@ public function setCommunicationFormat($communicationFormat)
{
$allowedValues = $this->getCommunicationFormatAllowableValues();
if (!in_array($communicationFormat, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'communicationFormat', must be one of '%s'",
"communicationFormat: unexpected enum value '%s' - Supported values are [%s]",
$communicationFormat,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +593 to 599
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "communicationFormat: unexpected enum value '%s' - Supported values are [%s]",
                    $communicationFormat,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down Expand Up @@ -648,11 +648,11 @@ public function setEncryptionProtocol($encryptionProtocol)
{
$allowedValues = $this->getEncryptionProtocolAllowableValues();
if (!in_array($encryptionProtocol, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'encryptionProtocol', must be one of '%s'",
"encryptionProtocol: unexpected enum value '%s' - Supported values are [%s]",
$encryptionProtocol,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down Expand Up @@ -682,11 +682,11 @@ public function setNetworkType($networkType)
{
$allowedValues = $this->getNetworkTypeAllowableValues();
if (!in_array($networkType, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'networkType', must be one of '%s'",
"networkType: unexpected enum value '%s' - Supported values are [%s]",
$networkType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/Management/DinersInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ public function setServiceLevel($serviceLevel)
{
$allowedValues = $this->getServiceLevelAllowableValues();
if (!in_array($serviceLevel, $allowedValues, true)) {
throw new \InvalidArgumentException(
error_log(
sprintf(
"Invalid value '%s' for 'serviceLevel', must be one of '%s'",
"serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
$serviceLevel,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);
Comment on lines +392 to 398
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

Using error_log instead of throwing an exception for invalid enum values can lead to silent failures. The previous implementation with throw new \InvalidArgumentException was safer as it immediately stopped execution and notified the caller of the invalid data. With error_log, the invalid value is assigned to the property, and the program continues, potentially leading to unexpected behavior and making bugs harder to trace. It is highly recommended to revert to throwing an exception to enforce the model's contract and maintain data integrity.

            throw new \InvalidArgumentException(
                sprintf(
                    "serviceLevel: unexpected enum value '%s' - Supported values are [%s]",
                    $serviceLevel,
                    implode(', ', $allowedValues)
                )
            );

}
Expand Down
Loading