Call-back functions

When everything goes as planned the payments are confirmed by the payer's browser when they return to the webstore; the payer is transferred by a redirect to the pmt_okreturn -URL that was in the payment process initiation.

Sometimes the payer does not return to the webstore. 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 recommend that every web store should integrate our Payment Status Query API so the web store platform can query the status of the payment if needed.

Svea Payments also has a callback function in which we call the pmt_okreturn -URL server to server. This is an optional service that is off by default. When the service is enabled, Svea Payments server will call the pmt_okreturn -URL when Svea Payments learns that the payment was made. That is, either when the payer returns from whichever payment method they chose, or when we find the money on our bank account, or when we do a status query to where the payer chose to pay.

When callback is enabled there will always be two calls to the ok url in the normal scenario where the payer returns to the web store succesfully after paying. The first one should be by the payer's browser and within 2 minutes the second call is made by the Svea Payments server. If the payer experiences connection problems the first call could be from Svea Payments server. In the case where the second call is by the payer's browser it would be good for the web store to show a message that indicates that the order was already marked as paid and not just display some generic error message.

Any HTTP status code other than 500-505 will be considered as success. In case of 500-505 responses, Svea Payments will retry the callback ten times during the following day or so.

For the callback to work the following conditions must be met:

  •  The web store must be able to handle sessionless call to the ok url.

  •  The first call to the ok url permanently marks the payment status as success. That is, nothing should change the payment status to cancel or error or anything other than success.

  •  Also, the web store must not consider multiple calls to the ok url as multiple payments.



For more information please contact our technical support: