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
8 changes: 4 additions & 4 deletions sdk-generation-log/transactionwebhooks.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"service": "transactionwebhooks",
"project": "java",
"generatedAt": "2026-05-14T14:23:20Z",
"openapiCommitSha": "cbc5406a2df1f24d50e40742f18342f7ca7f21fc",
"automationCommitSha": "6f06b47d0661f0891defe6b85461d2c367fbd284",
"libraryCommitSha": "5790580db2f8a931a68baba2bff9760b8aed2067"
"generatedAt": "2026-07-16T07:19:06Z",
"openapiCommitSha": "8ca5e35a2df8646fbed1793daeba735ebfcb821b",
"automationCommitSha": "a7fa5d57782b5065affe714e9d9caaf5009a1e24",
"libraryCommitSha": "503dcc66e435ded29884875f6a5bda4590cecb95"
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ public TransferViewCategoryData(PlatformPayment o) {
schemas.put("IssuedCard", new GenericType<IssuedCard>() {});
schemas.put("PlatformPayment", new GenericType<PlatformPayment>() {});
JSON.registerDescendants(TransferViewCategoryData.class, Collections.unmodifiableMap(schemas));
// Initialize and register the discriminator mappings.
Map<String, Class<?>> mappings = new HashMap<>();
mappings.put("bank", BankCategoryData.class);
mappings.put("internal", InternalCategoryData.class);
mappings.put("issuedCard", IssuedCard.class);
mappings.put("platformPayment", PlatformPayment.class);
mappings.put("BankCategoryData", BankCategoryData.class);
mappings.put("InternalCategoryData", InternalCategoryData.class);
mappings.put("IssuedCard", IssuedCard.class);
mappings.put("PlatformPayment", PlatformPayment.class);
mappings.put("TransferView_categoryData", TransferViewCategoryData.class);
JSON.registerDiscriminator(TransferViewCategoryData.class, "type", mappings);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.adyen.model.negativebalancewarningwebhooks.NegativeBalanceWarningWebhooksHandler;
import com.adyen.model.reportwebhooks.ReportNotificationRequest;
import com.adyen.model.reportwebhooks.ReportWebhooksHandler;
import com.adyen.model.transactionwebhooks.BankCategoryData;
import com.adyen.model.transactionwebhooks.TransactionNotificationRequestV4;
import com.adyen.model.transactionwebhooks.TransactionWebhooksHandler;
import com.adyen.model.transferwebhooks.InterchangeData;
Expand Down Expand Up @@ -256,6 +257,24 @@
Assertions.assertEquals("EVJN42272224222B5JB8BRC84N686ZEUR", request.getData().getId());
}

@Test
public void testTransactionWebhookBankCategoryDataParsing() {
String json =
getFileContents(
"mocks/notification/balancePlatform-transaction-created-bank-category.json");
TransactionWebhooksHandler webhookHandler = new TransactionWebhooksHandler(json);
Assertions.assertTrue(webhookHandler.getTransactionNotificationRequestV4().isPresent());
TransactionNotificationRequestV4 request =
webhookHandler.getTransactionNotificationRequestV4().get();
Assertions.assertEquals("EVJN00000000000000000000000003EUR", request.getData().getId());

BankCategoryData bankCategoryData =
request.getData().getTransfer().getCategoryData().getBankCategoryData();
Assertions.assertNotNull(bankCategoryData);
Assertions.assertEquals(BankCategoryData.TypeEnum.BANK, bankCategoryData.getType());
Assertions.assertEquals(BankCategoryData.PriorityEnum.REGULAR, bankCategoryData.getPriority());
}

@Test
public void testNegativeBalanceCompensationWarning() {
String json =
Expand Down Expand Up @@ -449,7 +468,7 @@
public void testGetDisputeNotificationRequestSuccess() {

String json = getFileContents("mocks/balancePlatform-webhooks/dispute-created.json");

Check warning on line 471 in src/test/java/com/adyen/webhooks/BalancePlatformWebhooksTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce the number of assertions from 35 to less than 25.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-java-api-library&issues=AZ9qu69xN1fS3h9xu5B9&open=AZ9qu69xN1fS3h9xu5B9&pullRequest=1983
DisputeWebhooksHandler handler = new DisputeWebhooksHandler(json);
Optional<DisputeNotificationRequest> optionalDisputeNotificationRequest =
handler.getDisputeNotificationRequest();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"data": {
"id": "EVJN00000000000000000000000003EUR",
"amount": {
"value": -10000,
"currency": "EUR"
},
"status": "booked",
"transfer": {
"categoryData": {
"priority": "regular",
"type": "bank"
},
"id": "3JNC3O5ZVFLLGV4B",
"reference": " Your internal reference for the transfer"
},
"valueDate": "2023-08-11T16:19:35+02:00",
"bookingDate": "2023-08-11T16:31:02+02:00",
"creationDate": "2023-08-11T16:19:35+02:00",
"description": "Your description of the transfer",
"referenceForBeneficiary": "Your reference sent to the beneficiary of the transfer",
"accountHolder": {
"id": "AH00000000000000000000001",
"reference": "Your reference for the account holder",
"description": "Your description of the account holder"
},
"balanceAccount": {
"id": "BA00000000000000000000001",
"description": "Your description of the balance account from where the amount is debited."
},
"paymentInstrument": {
"id": "PI00000000000000000000001",
"description": "Your description of the payment instrument"
},
"balancePlatform": "YOUR_BALANCE_PLATFORM"
},
"environment": "test",
"timestamp": "2023-08-11T16:16:35+02:00",
"type": "balancePlatform.transaction.created"
}
Loading