Skip to content

[documentcollector] Code generation: update services and models - #506

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

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

Conversation

@AdyenAutomationBot

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the documentcollector 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 August 21, 2026 14:01
@sonarqubecloud

Copy link
Copy Markdown

@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 the AdyenDocumentCollectorApi service, including the DocumentsApi class and its upload_cross_border_invoice method, along with an SDK generation log. However, two critical issues were identified in the review: first, the upload_cross_border_invoice method passes None instead of accepting and forwarding request_data to the underlying API client, which will cause the POST request to fail; second, the service name "documentCollector" is missing from the version_lookup dictionary in Adyen/client.py, which will result in a KeyError if an API version is configured on the client.

Comment on lines +16 to +24
def upload_cross_border_invoice(self, idempotency_key=None, **kwargs):
"""
Upload a document
"""
endpoint = self.baseUrl + "/crossBorderInvoices"
method = "POST"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)

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 upload_cross_border_invoice method is a POST request to upload a document, but it currently passes None as the request_data to call_adyen_api. This means no request body will be sent, which will cause the API call to fail. The method should accept request_data as a parameter and pass it to call_adyen_api.

Suggested change
def upload_cross_border_invoice(self, idempotency_key=None, **kwargs):
"""
Upload a document
"""
endpoint = self.baseUrl + "/crossBorderInvoices"
method = "POST"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
def upload_cross_border_invoice(self, request_data, idempotency_key=None, **kwargs):
"""
Upload a document
"""
endpoint = self.baseUrl + "/crossBorderInvoices"
method = "POST"
return self.client.call_adyen_api(
request_data, self.service, method, endpoint, idempotency_key, **kwargs
)


def __init__(self, client=None):
super().__init__(client=client)
self.service = "documentCollector"

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.

high

The service name "documentCollector" is not registered in the version_lookup dictionary within AdyenClient._set_url_version (located in Adyen/client.py). If a user has configured any API version on the client (e.g., api_checkout_version), calling any method on this service will raise a KeyError: 'documentCollector'. Please ensure that Adyen/client.py is updated to include this service in version_lookup.

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