Callback functions
Please make sure callback feature is enabled for your web store if it fulfils the requirements below.
When everything goes as planned the payments are confirmed instantly after the payer's browser has returned to the web store using pmt_okreturn
URL. That is, calling the pmt_okreturn
triggers the Payment Status Query API call from the web store to Svea to finally confirm the payment.
Sometimes the payer does not return to the web store. Loss of connection could be one cause for such event. Sometimes there could be other reasons for the payment confirmation to fail. That's why we require that every web store software has integrated the Payment Status Query API so the web store can query the status of the payments whenever needed.
Svea Payments also has a callback function in which we call the pmt_okreturn
-URL in a server-to-server fashion. This is an optional (yet recommended) feature that is off by default. When the callback feature is enabled, our server will call the pmt_okreturn
URL when we receive a payment confirmation by any means. That is, for example when the payer returns from whichever payment method they chose, or when we do a status query to the payment method provider the payer chose, or when we find the money from our customer assets bank account.
When callback feature is enabled, there will always be at least two (2) calls to the pmt_okreturn
URL in the normal scenario. First call is made when the payer returns to the web store successfully after paying. Within two (2) minutes, the second request (callback) is made by the Svea Payments' server. If the payer experiences connection problems the one and only request could be from Svea Payments' server. In case the first request was a callback and the second or any later request is made by the payer's browser, the web store should show an order or payment confirmation page and not an error page or message.
When performing the callback request, any HTTP status code other than 500-505 will be considered a success. In case of 500-505 responses, Svea Payments will retry the callback request up to ten (10) times during the following day or so, with increasing delay between the retries.
The Callback HTTP Request contains header X-Svea-Callback = true
that you can use to distinct it from the buyer’s browser request.
For the callback request to work the following conditions must be met by the webstore:
The web store must be able to handle sessionless call to the
pmt_okreturn
URL.The first call to the
pmt_okreturn
-URL (actually the status query triggered by it) permanently marks the payment status as success. That is, nothing must change the payment status after that. It must remain as a success.Also, the web store must not consider multiple calls to the
pmt_okreturn
URL as multiple payments.
Svea Payments Oy
info.payments@svea.fi
+358 9 4241 7050 (weekdays 8:00 - 16:00)
Saavutettavuusseloste