What is callback
Through the payment process it often happens that information about completing a payment does not reach back to the internet shop, which results in orderinformation will not be created, order status is not updated and order confirmations will never be emailed to the customer.
To avoid this ePay offers a callback service, which is a way to always get internet shop system updated with the vital payment information.
The callback service from ePay consists of a Microsoft. NET WebClient component (http://msdn2.microsoft.com/en-us/library/system.net.webclient.aspx). The WebClient is a very simple component that cannot handle flash, javascript, frames, iframes or other advanced logic, as an ordinary browser can handle. The component can only aktivate a webpage with a number of GET parameters. It is up to you to catch these parameters and update your system with these.
How to define callback
Callback established in 2 ways. Either in the form of a parameter with the name "callbackURL" in the payment form or by settings within the administration to ePay.
If one of the above solutions is being used, the defined URL will be put on a queue, with the same GET parameters as your acceptURL.
How callback works
At ePay is a service that calls back to the URL destinations located in that callback queue. This service is activated every minute where the service sends responses back to the URLs that has made payments and where callback has been activated. Ie callback occurs asynchronously relative to the remainder of the payment process where it is expected that the shops acceptURL is called before callbakcURL. If an error occurs in the callback, for example if your URL could not be accessed by the callback servers, or your URL returned an error (404, 500, etc.), ePay tries to callback to your URL once an hour, but maximum of 24 times(1 day).
Example of callback
Below is an illustration of how the callback operates.
The following is a description of the process during callback.

- A retailer pays for a order in an internet store. This payment information is sent to the ePay payment server. Among these paymentinformations is a acceptURL and a callbackURL found . it is important that the newly made order in the shop is already stored in the database that the internet store is based on , before the order is payed. Otherwise the order information is lost in case of errors in communication!
- The payment is approved at ePay, and a response to the internet store's callbackURL is created and put in queue at ePay. The callback server at ePay will later handle this callback (asynchronous).
- The retailer is now in response returned to the internet store's acceptURL. Here is a confirmation presented to the retailer. It is no longer necessary to update the order in the system, or send an order confirmation from when this should happen later in the callback. The reason for this is due to a risk of the retailer closes their browser (Internet Explorer, Mozilla, etc.) before the callback to the store's acceptURL is created.
- ePay callback server sends every minute a callback back to the receivers that are on queue. At delays/heavy load the callback process may take longer. It is therefore important that the internet store does not expect callbacks within a certain time period or before the acceptURL is called. The last mentioned is especially important because the whole process happens asynchronously!
- Callback is sent to the internet shops defined callbackURL. The same information is sent as GET parameters to the acceptURL. E.g. OrderID, time, amount, cur, fraud, MD5check, etc.
- If an error occurs during callback, the ePay callback server will try again after one hour. An error could occur if the callback server cannot access the internet shops callback URL or if there is a error in Internet shop (HTTP error code 404, 500, etc.). Generally speaking the callback server sees anything but HTTP code 200 as an error. HTTP code 200 means OK.
Each time there is an error occurs an email will be sent to the email-address specified on your ePay account to receive any system errors, including callback errors. It is now up to the administrator of the internet shop to investigate what is causing the callback to fail.