Skip to main content

Enable Single Sign-on with Paysera Profile

Integrate Paysera's secure OAuth API to let your customers sign in using their Paysera account. Quick, fast and convenient authentication with verified user data.

Integration Steps

1

Register Your Application

Contact Paysera support to register your client and receive credentials.

Keep mac_key secret at all times
→
2

Redirect to Authentication

Redirect users to Paysera's OAuth endpoint with your credentials.

https://www.paysera.com/frontend/oauth
→
3

Handle Authorization Code

Receive the authorization code when user is redirected back.

?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz
→
4

Exchange for Access Token

Make a POST request to exchange the code for access token.

POST https://wallet.paysera.com/oauth/v1/token

What is Login with Paysera?

Paysera offers a secure API that lets your customers sign in to your website using their Paysera account. This OAuth-based authentication system provides a quick, fast and convenient way for people to log into your website without having to create new accounts or remember additional passwords.

Real Identity

Users share their verified real identity including name, gender, locale, and phone number. Reduces spam and fake accounts.

Automatic Updates

Get up-to-date user information that's automatically synchronized when updated in Paysera system.

Permission Control

Users control what information they share. Start with basic permissions and request extended access as needed.

Use Cases

Quick Registration

Let users create accounts without filling registration forms or setting passwords. Obtain verified user data confirmed by Paysera.

Seamless Login

Enable users to sign in with the same credentials they use in Paysera. No need to store user authentication data in your system.

Implementation Options

Using PHP Library (Recommended)

Use Paysera's official PHP library for secure integration with built-in security parameter checking.

Installation

// Download from GitHub
https://github.com/paysera/lib-wallet-php-client

// Include and register autoloader
require_once 'lib-wallet-php-client-master/src/Paysera/WalletApi/Autoloader.php';
Paysera_WalletApi_Autoloader::register();

Basic Implementation

<?php
// Your credentials
$clientId = 'wkVd93h2uS';
$secret = 'IrdTc8uQodU7PRpLzzLTW6wqZAO6tAMU';

// Create API client (use createForSandbox() for testing)
$api = new Paysera_WalletApi($clientId, $secret);
$oauth = $api->oauthConsumer();

session_start();
try {
    if (!isset($_SESSION['token'])) {
        $token = $oauth->getOAuthAccessToken();
        if ($token === null) {
            // Redirect to authentication
            header('Location: ' . $oauth->getAuthorizationUri(array(
                Paysera_WalletApi_OAuth_Consumer::SCOPE_EMAIL,
            ), $redirectUri));
        } else {
            $_SESSION['token'] = $token;
        }
    }
    
    // Get user information
    if (isset($_SESSION['token'])) {
        $tokenRelatedClient = $api->walletClientWithToken($_SESSION['token']);
        $user = $tokenRelatedClient->getUser();
        $userID = $user->getId();
        $userEmail = $user->getEmail();
    }
} catch (Exception $e) {
    echo 'Error: ', $e->getMessage();
}
Download PHP Library

JavaScript Integration

Use Paysera's JavaScript SDK for frontend integration with OAuth dialog support.

Include Library & Initialize

<script src="https://static.paysera.com/js/WebToPayWallet.min.js"></script>
<script>
WebToPayWallet.init({
    'client_id': 'YOUR_CLIENT_ID',
    'language': 'en'
});
</script>

Login Button

<span onclick="WebToPayWallet.openDialog('path/to/oauth-script')" 
      id="loginWithPayseraBtn">
    <img src="https://static.paysera.com/assets/image/donate-button/paysera-sign-v1.png" />
    <span>Login with Paysera</span>
</span>

Available Scopes

Control what user information your application can access by requesting specific scopes:

SCOPE_EMAIL

Access to user's email address

SCOPE_FULL_NAME

Access to user's full name

SCOPE_PHONE

Access to user's phone number

SCOPE_ADDRESS

Access to user's address information

Note: Always request only the scopes your application actually needs. Users can see and approve each permission request.

Documentation & Resources

Login with Paysera Guide

Complete implementation guide with code examples and best practices

View Guide

Wallet API Reference

OAuth endpoints and user resource documentation

View API Reference

OAuth Documentation

Complete OAuth implementation guide (external)

View Docs