Skip to content

Commit 2834461

Browse files
authored
Correct README (webhook parsing) (#1475)
1 parent 50e6e23 commit 2834461

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ String hmacKey = "HMACKEY_RETREIVED_FROM_WEBHOOK_HEADER";
193193
HMACValidator hmacValidator = new HMACValidator();
194194
boolean authenticity = hmacValidator.validateHMAC(hmacKey, signKey, payload);
195195
~~~~
196-
If this bool returns true, one can proceed to deserialize against the desired webhook type:
196+
If this bool returns true, you can proceed to deserialize against the desired webhook type.
197+
Use the relevant webhook handler (i.e. ConfigurationWebhooksHandler) to obtain the object representing the event:
197198
~~~~ java
198-
BankingWebhookHandler webhookHandler = new BankingWebhookHandler(payload);
199+
ConfigurationWebhooksHandler webhookHandler = new ConfigurationWebhooksHandler(payload);
199200
// onAccountHolderNotificationRequest
200201
webhookHandler.getAccountHolderNotificationRequest().ifPresent((AccountHolderNotificationRequest event) -> {
201202
System.out.println(event.getData().getBalancePlatform());
@@ -206,9 +207,9 @@ webhookHandler.getBalanceAccountNotificationRequest().ifPresent((BalanceAccountN
206207
});
207208

208209
~~~~
209-
To deserialize Management Webhooks instead, please use the specific webhook handler:
210+
To deserialize Management Webhooks instead, please use the specific webhook handler `ManagementWebhooksHandler`:
210211
~~~~ java
211-
ManagementWebhookHandler webhookHandler = new ManagementWebhookHandler(payload);
212+
ManagementWebhooksHandler webhookHandler = new ManagementWebhooksHandler(payload);
212213
// onMerchantCreatedNotificationRequest
213214
webhookHandler.getMerchantCreatedNotificationRequest().isPresent((MerchantCreatedNotificationRequest event) -> {
214215
System.out.println(event.getData().getMerchantId());

0 commit comments

Comments
 (0)