Open franck102 opened 3 weeks ago
hi @franck102 , thank you for your question but I am not sure we understand what is the problem you are running into or trying to achieve with it.
How the payload signing can be used is defined here https://github.com/wallee-payment/java-sdk?tab=readme-ov-file#integrating-webhook-payload-signing-mechanism-into-webhook-callback-handler
Hi Thibault,
The sample you mention explains how to extract and verify the signature when receiving an event. I am not receiving a signature, and the state is always null... because I haven't found how to enable signatures.
[EDIT]: I found WebhookListenerCreate.enablePayloadSignatureAndState(true) which does enable signatures & state, problem solved.
So another issue, I have two problems after using this code to create my listener:
WebhookListenerCreate listenerCreate = new WebhookListenerCreate();
listenerCreate.entity(entity.id).url(urlId)
.name("passmate-" + tenantId + "-" + entity.name() + "-" + deploymentId)
.enablePayloadSignatureAndState(true)
.notifyEveryChange(false);
try {
listenerService.create(spaceId, listenerCreate);
}
catch (IOException e) {
_log.error("Could not create Wallee listener for " + entity.name(), e);
}
in my space UI if I check the created listener it says "Every change to Transaction entities will be reported." - so notifyEveryChange(false) apparently had no effect
I am receiving lots of duplicate events, with distinct IDs and timestamps - e.g. below 2 CONFIRMED, 3 PROCESSING, ...
15:26:03 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373733, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:02+0000', state='CONFIRMED'}
15:26:03 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373745, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:03+0000', state='CONFIRMED'}
15:26:03 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373749, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:03+0000', state='PROCESSING'}
15:26:03 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373752, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:03+0000', state='PROCESSING'}
15:26:04 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373760, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:04+0000', state='PROCESSING'}
15:26:06 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373773, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:06+0000', state='AUTHORIZED'}
15:26:08 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373771, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:08+0000', state='AUTHORIZED'}
15:26:08 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373779, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:08+0000', state='COMPLETED'}
15:26:09 RCVD Wallee webhook event WebhookEvent{tenantId='totem', eventId=464373805, entityId=267689861, listenerEntityId=1472041829003, listenerEntityTechnicalName='Transaction', spaceId=68607, webhookListenerId=500513, timestamp='2024-10-16T13:26:09+0000', state='FULFILL'}
Despite searching through the entire documentation and SDK source code I cannot figure out how to enable payload signing for webhooks with the SDK?
There is a WebhookIdentity entity that we can configure on a webhook create request, but no API to create or retrieve it? And the WebhookEncryptionService lets you retrieve a public key, but how do you create the key pair in the first place?
A complete example would be most useful...