Exemplo n.º 1
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
ini_set('max_execution_time', 0);
ini_set('memory_limit', '512M');
if (!isset($_SERVER['DOCUMENT_ROOT']) || !strlen($_SERVER['DOCUMENT_ROOT'])) {
    $_SERVER['DOCUMENT_ROOT'] = rtrim(realpath(pathinfo(__FILE__, PATHINFO_DIRNAME) . '/../../'), '/');
}
define('PRIMARY_WMID', '284917267100');
define('URL_UD', '0F2A144A-1BC0-433D-A1AC-A49901459726');
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/WMXI/WMXILogin.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/payment_keys.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/WMXI/WMXI.php';
$wmxi = new WMXILogin(URL_UD, PRIMARY_WMID, realpath($_SERVER['DOCUMENT_ROOT'] . '/classes/WMXI/WMXI.crt'));
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($wmid = $wmxi->AuthorizeWMID()) {
        $wmxi = new WMXI();
        $key = array('file' => WM_VERIFY_KEYFILE, 'pass' => WM_VERIFY_KEYPASS);
        $wmxi->Classic(WM_VERIFY_WMID, $key);
        $res = $wmxi->X11($wmid, 0, 1, 0);
        $res = $res->toObject();
        $v = $res->certinfo->attestat->row['tid'];
        echo $v;
        exit;
    }
}
?>
<a href="https://login.wmtransfer.com/GateKeeper.aspx?RID=<?php 
echo URL_UD;
?>
Exemplo n.º 2
0
<?php

session_start();
define('URL_UD', '6d9e022e-210e-4b5e-b6f4-9dd7013674b2');
define('PRIMARY_WMID', '058016335779');
require_once '../WMXILogin.php';
$wmxi = new WMXILogin(URL_UD, PRIMARY_WMID, realpath('../WMXI.crt'));
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if ($wmid = $wmxi->AuthorizeWMID()) {
        $_SESSION['WMID'] = $wmid;
    }
}
if (empty($_SESSION['WMID'])) {
    $wmxi->Login();
}
print 'Logged in as: ' . $_SESSION['WMID'];
Exemplo n.º 3
0
 /**
  * Проверка авторизация и верификация при помощи WebMoney
  * 
  * @global type $DB
  * @param type $uid
  * @return boolean
  */
 public function webmoney($uid)
 {
     global $DB;
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/WMXI/WMXILogin.php';
     $siteHolder = defined('WM_VERIFY_AUTHCHECK_WMID') ? WM_VERIFY_AUTHCHECK_WMID : WM_VERIFY_WMID;
     $wmxi = new WMXILogin(WM_VERIFY_URL_UD, $siteHolder, realpath(ABS_PATH . '/classes/WMXI/WMXI.crt'));
     if ($wmid = $wmxi->AuthorizeWMID()) {
         if ($res = $this->webmoneyCheckWMID($wmid, $uid)) {
             if ($this->verify($uid)) {
                 $ret = $DB->insert('verify_webmoney', array('user_id' => $uid, 'wmid' => $wmid, 'log' => $res->asXML(), 'result' => true));
                 return $ret;
             }
         }
     }
     if (empty($this->error)) {
         $this->error = 'Произошла ошибка во время верификации. Попробуйте ещё раз.';
     }
     return false;
 }