Example #1
0
/**
 * Проверка WebMoney WMID.
 * 
 * @param type $wmid
 *
 * @return \xajaxResponse
 */
function checkWebmoneyWMID($wmid)
{
    $objResponse = new xajaxResponse();
    $uid = get_uid(false);
    $error = false;
    if ($uid > 0) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/Verification.php';
        $verification = new Verification();
        if (!$verification->webmoneyCheckWMID($wmid, $uid)) {
            $error = $verification->getError();
        }
        if ($error) {
            $objResponse->script("window.verification_popup.showError('{$error}');");
        } else {
            $objResponse->script("window.verification_popup.openWindowWM('{$verification->getWMLoginUrl()}');");
        }
    }
    return $objResponse;
}