[documentcollector] Code generation: update services and models - #506
[documentcollector] Code generation: update services and models#506AdyenAutomationBot wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
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.
| 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 | ||
| ) |
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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.



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