Server-side Callbacks
Server-side callback is an optional feature that allows you to subscribe to a notification that we will send when the purchase is completed successfully.
The feature must be enabled by Avarda (per merchant) before it can be used.
Motivation
When a purchase is completed, we will always trigger a JavaScript callback in the browser. However, such a solution is unreliable by its nature. If the customer closes the browser window or loses Internet connection in the precise moment during the callback handling, the information that the payment has been completed might not reach the merchant’s application. Server-side callback, on the other hand, does not rely on the browser windows as the request is fired by our back-end and leads to your back-end (or any URL that you choose).
Subscribing
We will trigger the server-side callback only if you subscribe for it. The subscription must be made in the initialize payment method by specifying a URL that we should call in parameter: CompletedNotificationUrl
While not enforced by us, we strongly recommend that you use an HTTPS URL rather than an unencrypted HTTP, for security reasons.
HTTP Request Structure
The HTTP request body contains a JSON object with the following structure:
Callback re-attempts
The server side callback expects a 2xx response from your web server. Avarda will keep attempting these backend notifications every 10 minutes up to a maximum of 20 attempts – in case of any non 2xx HTTP response is received to the callback.
Authentication
Please contact us if you would like us to include an Authorization HTTP header to the requests that we send. This way, you can implement an HTTP Basic Authentication, or an authentication based on JWT tokens.
The only limitation on our side is that the header data that we send is static so should you choose the JWT way, you must provide a token that has a very long expiration date or make sure to renew it manually. For security reasons, we recommend that you do use authentication.
If you have questions or need help please contact us – delivery@avarda.com