|
33 | 33 | use Adyen\Model\TokenizationWebhooks\TokenizationUpdatedDetailsNotificationRequest; |
34 | 34 | use Adyen\Model\TransactionWebhooks\TransactionNotificationRequestV4; |
35 | 35 | use Adyen\Model\BalanceWebhooks\BalanceAccountBalanceNotificationRequest; |
| 36 | +use Adyen\Model\BalanceWebhooks\ReleasedBlockedBalanceNotificationRequest; |
36 | 37 | use Adyen\Service\BankingWebhookParser; |
37 | 38 | use Adyen\Service\ManagementWebhookParser; |
38 | 39 | use Adyen\Service\TokenizationWebhookParser; |
@@ -513,4 +514,49 @@ public function testTokenizationWebhookRecurringTokenAlreadyExisting() |
513 | 514 | self::assertEquals("recurring.token.alreadyExisting", $result->getType()); |
514 | 515 | self::assertEquals("test", $result->getEnvironment()); |
515 | 516 | } |
| 517 | + |
| 518 | + public function testBankingWebhookParserReleasedBlockedBalanceNotificationRequest() |
| 519 | + { |
| 520 | + $jsonString = '{ |
| 521 | + "data": { |
| 522 | + "accountHolder": { |
| 523 | + "description": "Account holder for retail operations", |
| 524 | + "id": "AH00000000000000000001", |
| 525 | + "reference": "Store_001" |
| 526 | + }, |
| 527 | + "amount": { |
| 528 | + "currency": "EUR", |
| 529 | + "value": 25000 |
| 530 | + }, |
| 531 | + "balanceAccount": { |
| 532 | + "description": "Main operating account", |
| 533 | + "id": "BA00000000000000000001", |
| 534 | + "reference": "OP_ACCT_MAIN" |
| 535 | + }, |
| 536 | + "balancePlatform": "YOUR_BALANCE_PLATFORM", |
| 537 | + "batchReference": "BATCH_REF_20250925", |
| 538 | + "blockedBalanceAfter": { |
| 539 | + "currency": "EUR", |
| 540 | + "value": -75000 |
| 541 | + }, |
| 542 | + "blockedBalanceBefore": { |
| 543 | + "currency": "EUR", |
| 544 | + "value": -100000 |
| 545 | + }, |
| 546 | + "creationDate": "2025-09-25T14:30:00Z", |
| 547 | + "valueDate": "2025-09-25T14:35:00Z" |
| 548 | + }, |
| 549 | + "environment": "test", |
| 550 | + "timestamp": "2025-09-25T14:35:00Z", |
| 551 | + "type": "balancePlatform.balanceAccount.balance.block.released" |
| 552 | +}'; |
| 553 | + |
| 554 | + $webhookParser = new BankingWebhookParser($jsonString); |
| 555 | + $result = $webhookParser->getReleasedBlockedBalanceNotificationRequest(); |
| 556 | + self::assertEquals(ReleasedBlockedBalanceNotificationRequest::class, get_class($result)); |
| 557 | + self::assertEquals("balancePlatform.balanceAccount.balance.block.released", $result->getType()); |
| 558 | + self::assertEquals("test", $result->getEnvironment()); |
| 559 | + self::assertEquals("AH00000000000000000001", $result->getData()->getAccountHolder()->getId()); |
| 560 | + self::assertEquals(25000, $result->getData()->getAmount()->getValue()); |
| 561 | + } |
516 | 562 | } |
0 commit comments