[transfers] Code generation: update services and models - #1978
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the CashOut feature to the Transfers API, adding several new model classes (such as CashOut, CashOutInfo, and CashOutTransfer), a standardized error response model, and a new CashOutApi service to initiate cashouts. Additionally, the CapitalApi service has been renamed to CapitalDeprecatedApi, and some Javadoc descriptions in Transfer and TransferData were updated. Feedback on these changes highlights two key issues: first, renaming CapitalApi to CapitalDeprecatedApi introduces a breaking change for existing integrations, so it is recommended to retain the original class name and mark it as @deprecated instead; second, a null check should be added to CashOutApi.initiateCashout for the required cashOutInfo parameter to prevent a potential NullPointerException.
| public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) | ||
| throws ApiException, IOException { | ||
| String requestBody = cashOutInfo.toJson(); |
There was a problem hiding this comment.
The cashOutInfo parameter is marked as required, but there is no null check before calling cashOutInfo.toJson(). If a caller passes null, this will throw a NullPointerException. It is safer to validate the input and throw an IllegalArgumentException with a clear error message.
| public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) | |
| throws ApiException, IOException { | |
| String requestBody = cashOutInfo.toJson(); | |
| public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) | |
| throws ApiException, IOException { | |
| if (cashOutInfo == null) { | |
| throw new IllegalArgumentException("Please provide the cashOutInfo parameter"); | |
| } | |
| String requestBody = cashOutInfo.toJson(); |
There was a problem hiding this comment.
Known issue to be addressed in a follow-up PR
jeandersonbc
left a comment
There was a problem hiding this comment.
Bad generation of Capital Service: CapitalDeprecatedApi
Future reviews/generation must take this into consideration.
cf677ba to
e2490e1
Compare
244c2a7 to
eeca411
Compare
fd1d47f to
87ef0dd
Compare
e5f0ed1 to
3e8f300
Compare
bb3ddde to
cd3a64d
Compare
4102fc9 to
0908a98
Compare
0908a98 to
f99770c
Compare
… - networkReason and tracing
|



This PR contains the automated changes for the
transfersservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.This PR contains the automated changes for the transfers service, plus follow-up test coverage and a generator hardening fix.
The commit history of this PR reflects the adyen-openapi commits that have been applied.
New Features 💎
New CashOut feature
POST /btl/v4/cashouts)CashOut,CashOutInfo,CashOutInfoCounterparty,CashOutTransfer.Transfer tracing & network reason
TransferData.networkReasonandTransferData.tracingTransferEvent.tracingData.NetworkReason,TransferDataTracing,TransferEventTracingData,UKFpsTracingData,USAchTracingData.Tests / fixtures
initiateCashoutTest(asserts response + verifies request URL/body/method)initiateCashoutNullBodyThrowsTest.getTransferTestandget-transfer-success.jsonto cover networkReason, tracing, and event tracingData.defaultErrorResponseEntityTest.post-cashouts-200.json.