When a user successfully transfers money and that money reaches your account, Paysera requests your indicated address callbackurl and transfers all required information about the performed payment.

Parameter callbackurl is the address of the script on your website, which informs Paysera system about the request on the successful payment. The answer is generated in the following way:

1. Create a folder.

Create a folder named libwebtopay. It will contain all files related to the payment integration.

2. Download libwebtopay library.

Download WebToPay.php file to the created folder libwebtopay.

3. Create a callback.php file.

Create a file named callback.php in the folder libwebtopay. The content of this file has to be:



try {
    $response = WebToPay::checkResponse($_GET, [
        'project_id' => 'project_id_example',
        'sign_password' => 'project_password_example',

        // Path to file to which all requests will be logged.
        // If you plan to use this feature, make sure that log file is not accessible from outside.
        // 'log' => 'webtopay.log',

    echo 'OK Thank you for sending';
catch (Exception $e) {
    echo get_class($e) . ': ' . $e->getMessage();

It is necessary to transfer all data received from Paysera to the method WebToPay::checkResponse. It is required for the check of data integrity. If there is no parameter at all, or values of parameters are not equal, then WebToPayException exception will be invoked.

Unique project number. Only activated projects can accept payments.
Project password. You can find it when logged in to Paysera system with your user. Choose "service management" and then press "general settings".

After checking $_GET data, if everything is correct, it is necessary to return the answer. An example is shown above (echo 'OK';). Possible variants of answers:

OK <text>
The text indicated after the keyword OK will be sent back as a responsive message.
Example: "OK Thank you for sending" (the responsive message will be: "Thank you for sending").
The sender will not receive any answer in this case. You will be able to send it later, in one week.
WAPPUSH <url> <text>
The system will send the answer to the sender by the Wap Push method.
Example: "WAPPUSH http://www.address.com/services/link service description".

4. Sending of the response message.

You can send the answer in one week with libwebtopay function, if you do not deliver it immediately through OK <text>:


// Including libwebtopay library

try {
    // Validating data of processed payment.
        // Unique message number in our system. You got it by message.
        'id' => 0,

        // Responsive message
        'msg' => 'Thank you for sending',

        // Generated project password from paysera.com system.
        'sign_password' => 'secret',

        // Path to file to which all requests will be logged
        // If you plan to use this feature, make sure that log file
        // is not accessible from outside.
        //'log' => 'webtopay.log',
catch (Exception $e) {
    echo get_class($e).': '.$e->getMessage();


To integrate the system for Macro Payments we recommend using our prepared open source library. Library performs all required inspections of saveable, transmissible and receivable data.

  • WebToPay for PHP (from GitHub).
    $ git clone https://github.com/paysera/lib-webtopay
  • WebToPay for .NET (from GitHub).
    $ git clone https://github.com/evp/webtopay-lib-dotnet

For libwebtopay to work successfully, file libwebtopay/WebToPay.php from archives is enough. Other files are meant for tests, examples and explanations.

Attention: libwebtopay is suitable to use with both Micro Payments and Macro Payments.

You are able to test libwebtopay in demo mode. To run demo version in your web browser address bar add:


Attention: mentioned path to demo folder would be different in address, if you extracted archive in other place.

Attention: to try demonstration, indicate your project ID from paysera.com website in projectid field. Demonstration wont work, if you try it from your computer (localhost).


Bellow you can find detailed specification of transmissible and receivable data, if you do not have an ability to use libwebtopaylibrary.

Paysera sends the answer to your indicated address: callbackurl. Additional GET parameters (list of description is below) are added to your indicated address callbackurl. All these parameters are transmissible with prefix wp_.

A short number the message was sent to.
Content of the SMS message with keyword and subkeyword (up to 160 symbols).
Mobile number the message was received from.
Name of the mobile operator ("Bitė", "TELE2", "Omnitel", "Orange", "LMT" and etc).
Price of the message in cents. For example, 100 (1 lt), 500 (5 lt) and etc.
Payment currency (USD, EUR) you want the client to pay in. If the selected currency cannot be accepted by a specific payment method, the system will convert it automatically to the acceptable currency, according to the currency rate of the day. Payamount and paycurrency answers will be sent to your website.
Double-figure country code. (LT, EE, LV, UA, RU and etc)
Unique message number in our system.
Parameter, which checks if you get the answer from our server. This is the most reliable way to check it.
Parameter, which checks if you get the answer from our server. This is not as reliable as _ss2 to check it. You can download script example from here.
The parameter, which allows to test the connection. The payment is not executed, but the result is returned immediately, as if the payment has been made. To test, it is necessary to activate the mode for a particular project by logging in and selecting: "Manage projects" -> "Payment gateway" (for a specific project) -> "Allow test payments" (check).