Integration Steps
Register Your Application
Contact Paysera support to register your client and receive credentials.
Keep mac_key secret at all timesRedirect to Authentication
Redirect users to Paysera's OAuth endpoint with your credentials.
https://www.paysera.com/frontend/oauthHandle Authorization Code
Receive the authorization code when user is redirected back.
?code=SplxlOBeZQQYbYS6WxSbIA&state=xyzExchange for Access Token
Make a POST request to exchange the code for access token.
POST https://wallet.paysera.com/oauth/v1/tokenWhat 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();
}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:
Access to user's email address
Access to user's full name
Access to user's phone number
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