@@ -193,9 +193,10 @@ String hmacKey = "HMACKEY_RETREIVED_FROM_WEBHOOK_HEADER";
193
193
HMACValidator hmacValidator = new HMACValidator ();
194
194
boolean authenticity = hmacValidator. validateHMAC(hmacKey, signKey, payload);
195
195
~~~~
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:
197
198
~~~~ java
198
- BankingWebhookHandler webhookHandler = new BankingWebhookHandler (payload);
199
+ ConfigurationWebhooksHandler webhookHandler = new ConfigurationWebhooksHandler (payload);
199
200
// onAccountHolderNotificationRequest
200
201
webhookHandler. getAccountHolderNotificationRequest(). ifPresent((AccountHolderNotificationRequest event) - > {
201
202
System . out. println(event. getData(). getBalancePlatform());
@@ -206,9 +207,9 @@ webhookHandler.getBalanceAccountNotificationRequest().ifPresent((BalanceAccountN
206
207
});
207
208
208
209
~~~~
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 ` :
210
211
~~~~ java
211
- ManagementWebhookHandler webhookHandler = new ManagementWebhookHandler (payload);
212
+ ManagementWebhooksHandler webhookHandler = new ManagementWebhooksHandler (payload);
212
213
// onMerchantCreatedNotificationRequest
213
214
webhookHandler. getMerchantCreatedNotificationRequest(). isPresent((MerchantCreatedNotificationRequest event) - > {
214
215
System . out. println(event. getData(). getMerchantId());
0 commit comments