To subscribe event/integrate with webhook, use Elements Merchant console UI to simply create a webhook configuration.
Create an endpoint on your server can receive the requests from Elements, notifying you about events that happen on your account such as charge expired, disputed initiated by customer etc.
Configure which events you want to listen, recommendation is only listen to the events you care.
As soon as you received the event, check the event type and use the proper handler to handle the events. Or you can also create multiple endpoint, to handle different event separately.
return a 200 response to Elements as soon as possible so that Elements acknowledge the Event is sent to you successfully. if the handling is long-running process, think about handle the event asynchronously outside the webhook endpoint.
Updated 7 months ago