Skip to content

Conversation

@gcatanese
Copy link
Contributor

@gcatanese gcatanese commented Aug 14, 2025

Generate webhook models to reflect latest OpenAPI specs:

  • ACS Webhooks
  • Report Webhooks
  • Transaction Webhooks
  • Transfers Webhooks

ACS Webhooks

  • Update deserialization to handle unknown enums
  • Add support for balancePlatform.authentication.relayed event
  • In RelayedAuthenticationRequest add new attributes threeDSRequestorAppURL, environment, timestamp, type

Report Webhooks

  • Update deserialization to handle unknown enums

Transaction Webhooks

  • Update deserialization to handle unknown enums
  • In IssuedCard add new attribute threeDSecure
  • In TransferViewCategoryData add new attribute threeDSecure

Tranfers Webhooks

  • Update deserialization to handle unknown enums
  • In IssuedCard add new attribute threeDSecure
  • In TransferViewCategoryData add new attribute threeDSecure
  • In AdditionalBankIdentification add new enums auBsbCode and caRoutingNumber
  • Add attribute executionDate in Transfer, TransferData and TransferInfo
  • Added email and url to PartyIdentification and UltimatePartyIdentification
  • In TransferData add new attribute createdAt and updatedAt, deprecate creationDate (use instead createdAt)
  • Added approvalExpired to TransferData and TransferEvent

@gcatanese gcatanese requested a review from a team as a code owner August 14, 2025 08:56
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 @gcatanese, 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 updates the webhook models for ACS, Report, Transfers, and Transaction services to reflect the latest OpenAPI specifications. Key changes include refining existing model properties, enhancing error handling for enum validations, and introducing new models and fields to support expanded data requirements and functionalities, such as detailed 3D Secure information and precise transfer scheduling. The updates ensure that the webhook integration remains current and robust.

Highlights

  • Updated Webhook Models: The models for ACS, Report, Transfers, and Transaction webhooks have been regenerated to align with the latest OpenAPI specifications, ensuring up-to-date API interactions.
  • Enhanced Error Handling for Enum Values: Error handling for invalid enum values has been improved across various models, changing from throwing InvalidArgumentException to logging errors using error_log. This prevents application crashes due to unexpected data while still providing valuable debugging information.
  • Deprecation of SplFileObject Deserialization: The SplFileObject deserialization logic has been removed from ObjectSerializer.php in multiple webhook modules, streamlining the serialization process and potentially simplifying file handling.
  • Enriched Relayed Authentication Data: The RelayedAuthenticationRequest model in ACS Webhooks now includes new fields: environment, threeDSRequestorAppURL, timestamp, and type, providing richer context for relayed authentication requests.
  • Introduction of ThreeDSecure Model: A new ThreeDSecure model has been introduced and integrated into IssuedCard and TransferViewCategoryData within Transaction and Transfer Webhooks, allowing for more detailed 3D Secure information to be processed.
  • New ExecutionDate Model for Transfers: The ExecutionDate model has been added to Transfer Webhooks, including date and timezone fields, and integrated into TransferData. This enables more precise scheduling and tracking of transfers.
  • Expanded Party Identification Details: The PartyIdentification model in Transfer Webhooks now includes email and url fields, enhancing the information available for counterparty identification.
  • Extended International Bank Identification: Support for Australian BSB codes (auBsbCode) and Canadian routing numbers (caRoutingNumber) has been added to AdditionalBankIdentification in Transfer Webhooks, broadening international bank identification capabilities.
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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

  1. 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.

@sonarqubecloud
Copy link

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 various webhook models based on the latest OpenAPI specifications. The changes include adding new models and properties, updating documentation, and modifying error handling for invalid enum values.

A major concern is the change in error handling for invalid enum values in setters across numerous model classes. The previous implementation threw an InvalidArgumentException, which is a fail-fast approach. The new implementation uses error_log and continues execution, which can lead to objects being in an invalid state. This can cause subtle bugs that are hard to trace. It is highly recommended to revert this change and throw an exception when an invalid enum value is provided to ensure data integrity and robust error handling.

Comment on lines +323 to 329
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)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setStatus() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid status value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'status', must be one of '%s'",
                    $status,
                    implode("', '", $allowedValues)
                )
            );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gemini-code-assist This is done by design: the goal is not to throw an exception when an unknown value is encountered, but rather just log a warning and use the value as-is (this is a valid value as it is defined by the API). Revise and close all your comments related to this issue.

Choose a reason for hiding this comment

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

Thank you for clarifying the design decision. I understand that the intention is to log unexpected enum values as warnings and proceed, as these are considered valid by the API. I will revise and close all related comments accordingly.

Comment on lines +737 to 743
error_log(
sprintf(
"Invalid value '%s' for 'challengeIndicator', must be one of '%s'",
"challengeIndicator: unexpected enum value '%s' - Supported values are [%s]",
$challengeIndicator,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setChallengeIndicator() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid challengeIndicator value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'challengeIndicator', must be one of '%s'",
                    $challengeIndicator,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +795 to 801
error_log(
sprintf(
"Invalid value '%s' for 'deviceChannel', must be one of '%s'",
"deviceChannel: unexpected enum value '%s' - Supported values are [%s]",
$deviceChannel,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setDeviceChannel() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid deviceChannel value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'deviceChannel', must be one of '%s'",
                    $deviceChannel,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +853 to 859
error_log(
sprintf(
"Invalid value '%s' for 'exemptionIndicator', must be one of '%s'",
"exemptionIndicator: unexpected enum value '%s' - Supported values are [%s]",
$exemptionIndicator,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setExemptionIndicator() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid exemptionIndicator value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'exemptionIndicator', must be one of '%s'",
                    $exemptionIndicator,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +911 to 917
error_log(
sprintf(
"Invalid value '%s' for 'messageCategory', must be one of '%s'",
"messageCategory: unexpected enum value '%s' - Supported values are [%s]",
$messageCategory,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setMessageCategory() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid messageCategory value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'messageCategory', must be one of '%s'",
                    $messageCategory,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +419 to 425
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setType() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid type value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'type', must be one of '%s'",
                    $type,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +353 to 359
error_log(
sprintf(
"Invalid value '%s' for 'scaOnApproval', must be one of '%s'",
"scaOnApproval: unexpected enum value '%s' - Supported values are [%s]",
$scaOnApproval,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setScaOnApproval() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid scaOnApproval value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'scaOnApproval', must be one of '%s'",
                    $scaOnApproval,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +389 to 395
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setType() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid type value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'type', must be one of '%s'",
                    $type,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +395 to 401
error_log(
sprintf(
"Invalid value '%s' for 'accountType', must be one of '%s'",
"accountType: unexpected enum value '%s' - Supported values are [%s]",
$accountType,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setAccountType() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid accountType value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'accountType', must be one of '%s'",
                    $accountType,
                    implode("', '", $allowedValues)
                )
            );

Comment on lines +453 to 459
error_log(
sprintf(
"Invalid value '%s' for 'type', must be one of '%s'",
"type: unexpected enum value '%s' - Supported values are [%s]",
$type,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

The error handling for invalid enum values in setType() has been changed from throwing an InvalidArgumentException to logging an error with error_log. This is a significant change that can lead to issues. By not throwing an exception, the application will continue to run with an invalid type value, which can cause unpredictable behavior and hard-to-debug issues later on. It's better to fail fast. Please consider reverting this to throw an InvalidArgumentException.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'type', must be one of '%s'",
                    $type,
                    implode("', '", $allowedValues)
                )
            );

@gemini-code-assist
Copy link

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@gcatanese gcatanese merged commit 445ba7f into main Aug 14, 2025
9 checks passed
@gcatanese gcatanese deleted the regenerate-all-webhooks branch August 14, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants