예제 #1
0
 public function readRequestVariables() {
     $input = $this->readXmlData();
     $this->debug("Input get: ".$input);
     try {
         $xml = new SimpleXMLElement($input);
     } catch (Exception $e) {
         $this->setPaymentStatus("Failed");
         $this->debug('Wrong XML format.');
         $this->outputError();
         return;
     }
           
     // assign posted variables to local variables
     $customField = 'custom_field_'.Gpf_Settings::get(UltraCart_Config::CUSTOM_FIELD_NUMBER);
     $this->debug("Custom field number: ".Gpf_Settings::get(UltraCart_Config::CUSTOM_FIELD_NUMBER));
     $cookieValue = (string)$xml->order->$customField;
     
     $this->setCookie($cookieValue);
     
     $this->setTotalCost($this->computeTotalCost($xml));
                           
     $this->setEmail((string)$xml->order->email);
     $this->setTransactionID((string)$xml->order->order_id);
     $this->setProductID((string)$xml->order->item->item_id);
     
     $this->setPaymentStatus((string)$xml->order->payment_status);
     $this->outputSuccess();
 }
예제 #2
0
    protected function executeCurl($xmlRequest, $headers) {
        $url = '';
        if (!$this->containsProtocol(Gpf_Settings::get(BusinessCatalyst_Config::BC_DOMAIN_NAME))) {
            $url = 'http://';
        }

        $url .= Gpf_Settings::get(BusinessCatalyst_Config::BC_DOMAIN_NAME);

        if (!$this->endsWithSlash($url)) {
            $url .= '/';
        }

        $url .= 'catalystwebservice/catalystcrmwebservice.asmx';

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);

        $response = curl_exec($ch);
        if ($response === false) {
            Pap_Contexts_Action::getContextInstance()->debug('Error in communication with bc: ' . curl_error($ch));
            throw new Gpf_Exception(curl_error($ch));
        }
        return $response;
    }
예제 #3
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::PROCESS_WHOLE_CART_AS_ONE_TRANSACTION, Gpf_Settings::get(self::PROCESS_WHOLE_CART_AS_ONE_TRANSACTION));
     $form->addField(self::MERCHANT_ID, Gpf_Settings::get(self::MERCHANT_ID));
     $form->addField(self::API_SIGNATURE, Gpf_Settings::get(self::API_SIGNATURE));
     return $form;
 }
 /**
  * Validate Db_Row
  *
  * @param Gpf_DbEngine_Row $row
  * @throws Gpf_DbEngine_Row_ConstraintException
  */
 public function validate(Gpf_DbEngine_Row $row)
 {
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH) > Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)) {
         return;
     }
     if (strlen($row->get($this->passwordField)) < Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH)) {
         throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Minimum length of password is %s characters', Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH)));
     }
     if (strlen($row->get($this->passwordField)) > Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)) {
         throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Maximum length of password is %s characters', Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)));
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_LETTERS) == Gpf::YES) {
         if (preg_match('/[a-zA-Z]/', $row->get($this->passwordField)) == 0) {
             throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one letter (a-z, A-Z)'));
         }
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_DIGITS) == Gpf::YES) {
         if (preg_match('/[0-9]/', $row->get($this->passwordField)) == 0) {
             throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one digit (0-9)'));
         }
     }
     if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_SPECIAL) == Gpf::YES) {
         if (preg_match('/[' . preg_quote(Gpf_Common_String::SPECIAL_CHARS) . ']/', $row->get($this->passwordField)) == 0) {
             throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one special character (%s)', Gpf_Common_String::SPECIAL_CHARS));
         }
     }
 }
예제 #5
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::CUSTOM_SEPARATOR, Gpf_Settings::get(self::CUSTOM_SEPARATOR));
     $form->addField(self::CUSTOM_ITEM_NUMBER, Gpf_Settings::get(self::CUSTOM_ITEM_NUMBER));
     $form->addField(self::SECONDARY_PASSWORD, Gpf_Settings::get(self::SECONDARY_PASSWORD));
     return $form;
 }
예제 #6
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::CUSTOM_SEPARATOR, Gpf_Settings::get(self::CUSTOM_SEPARATOR));
     $form->addField(self::CUSTOM_FIELD_NUMBER, Gpf_Settings::get(self::CUSTOM_FIELD_NUMBER));
     $form->addField(self::RESPONSE_TYPE, Gpf_Settings::get(self::RESPONSE_TYPE));
     return $form;
 }
예제 #7
0
 public function __construct()
 {
     $this->username = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_USERNAME);
     $this->password = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_PASSWORD);
     $this->hostname = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_HOSTNAME);
     $this->directory = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_DIRECTORY);
 }
예제 #8
0
    public function readRequestVariables() {
        $postvars = '';
        foreach ($_POST as $key => $value) {
            $value = stripslashes(stripslashes($value));
            $postvars .= "$key=$value; ";
        }
        $this->debug("  SolidTrustPay callback: POST variables: $postvars");

        $request = $this->getRequestObject();
        $cookieValue = stripslashes($request->getPostParam('user'.Gpf_Settings::get(SolidTrustPay_Config::CUSTOM_ITEM_NUMBER)));
        try {
            $customSeparator = Gpf_Settings::get(SolidTrustPay_Config::CUSTOM_SEPARATOR);
            if ($customSeparator != '') {
                $explodedCookieValue = explode($customSeparator, $cookieValue, 2);
                if (count($explodedCookieValue) == 2) {
                    $cookieValue = $explodedCookieValue[1];
                }
            }
        } catch (Gpf_Exception $e) {
        }
        $this->setCookie($cookieValue);
        
        $this->setTotalCost($request->getPostParam('amount'));
        $this->setTransactionID($request->getPostParam('tr_id'));
        $this->setProductID($request->getPostParam('item_id'));
        $this->setPaymentStatus($request->getPostParam('status'));
        if ($request->getPostParam('status') == '') {
            $this->setPaymentStatus($request->getPostParam('Status'));
        }
        $this->setCurrency($request->getPostParam('currency'));
        $this->setData1($request->getPostParam('memo'));
        $this->setData2($request->getPostParam('payerAccount'));
    }
예제 #9
0
 /**
  * @service report_problem write
  * 
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function report(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     
     $subject = 'PAP4: '.$form->getFieldValue('subject');
     
     $message = 'License: '.$form->getFieldValue('licenseId').'<br>'.
                'Product: <b>'.Gpf_Settings::get(Pap_Settings::BRANDING_TEXT_POST_AFFILIATE_PRO).' '.Gpf_Settings::get(Gpf_Settings_Gpf::VARIATION).'</b><br>'.
                'Version: <b>'.Gpf_Application::getInstance()->getVersion().'</b><br>'.
                'Url: <a href="'.Gpf_Paths::getInstance()->getFullBaseServerUrl().'">'.Gpf_Paths::getInstance()->getFullBaseServerUrl().'</a><br>'.
                '-------------------------------------------------------------------------------<br>'.
                $form->getFieldValue('message');
     
     $mail = new Gpf_Db_Mail();
     $mail->setSubject($subject);
     $mail->setHtmlBody($message);
     $mail->setFromMail($form->getFieldValue('email'));
     $mail->setRecipients("*****@*****.**");
     
     try {
         $mail->insert();
         $mail->scheduleNow(true);
         $form->setInfoMessage($this->_("Email sent"));
     } catch (Exception $e) {
         $form->setErrorMessage($this->_("Error while sending mail"));
     }
     return $form;
 }
예제 #10
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::VALIDITY_DAYS, Gpf_Settings::get(self::VALIDITY_DAYS));
     $form->addField(self::BONUS_TYPE, Gpf_Settings::get(self::BONUS_TYPE));
     $form->addField(self::BONUS_AMOUNT, Gpf_Settings::get(self::BONUS_AMOUNT));
     return $form;
 }
예제 #11
0
 /**
  * @return Gpf_DbEngine_Database
  */
 public static function getDatabase()
 {
     if (self::$database === null) {
         self::create(Gpf_Settings::get(Gpf_Settings_Gpf::DB_HOSTNAME), Gpf_Settings::get(Gpf_Settings_Gpf::DB_USERNAME), Gpf_Settings::get(Gpf_Settings_Gpf::DB_PASSWORD), Gpf_Settings::get(Gpf_Settings_Gpf::DB_DATABASE));
     }
     return self::$database;
 }
예제 #12
0
 /**
  * Add minimum one character into password from string includeCharacters
  * if it doesn't contain already such character
  *
  * @param $settingName
  * @param $includeCharacters
  * @param $password
  * @return unknown_type
  */
 private static function normalizePassword($settingName, $includeCharacters, $password)
 {
     if (Gpf_Settings::get($settingName) == Gpf::YES && !preg_match('/[' . preg_quote($includeCharacters) . ']/', $password)) {
         $password[rand(0, strlen($password) - 1)] = $includeCharacters[rand(0, strlen($includeCharacters) - 1)];
     }
     return $password;
 }
    private function getValidityInSeconds() {
        $validity = Gpf_Settings::get(Pap_Settings::IP_VALIDITY_SETTING_NAME);
        if($validity == '' || $validity == '0' || !is_numeric($validity)) {
            throw new Gpf_Exception("    IP address validity period is not correct: '$validity'");
        }
        $validityPeriod = Gpf_Settings::get(Pap_Settings::IP_VALIDITY_FORMAT_SETTING_NAME);
        if(!in_array($validityPeriod, array(Pap_Merchants_Config_TrackingForm::VALIDITY_DAYS,
        Pap_Merchants_Config_TrackingForm::VALIDITY_HOURS,
        Pap_Merchants_Config_TrackingForm::VALIDITY_MINUTES))) {
            throw new Gpf_Exception("    IP address validity period is not correct: '$validityPeriod'");
        }

        switch($validityPeriod) {
            case Pap_Merchants_Config_TrackingForm::VALIDITY_DAYS:
                return $validity * 86400;
                 
            case Pap_Merchants_Config_TrackingForm::VALIDITY_HOURS:
                return $validity * 3600;
                 
            case Pap_Merchants_Config_TrackingForm::VALIDITY_MINUTES:
                return $validity * 60;
                 
            default: return 0;
        }
    }
    protected function loadItems($userId)  {
        $maxTiers = Gpf_Settings::get(Pap_Settings::TIERS_VISIBLE_TO_AFFILIATE);
        if ($maxTiers == -1) {
            return parent::loadItems($userId);
        }

        $currentUserId = Gpf_Session::getAuthUser()->getPapUserId();
        $numberOfTiers = -1;
        if($userId != '') {
            try {
                $numberOfTiers = $this->getNumberOfTiersToAncestor($userId, $currentUserId);
            } catch (Gpf_Exception $e) {
            }
        }

        if ($userId == '' && $maxTiers == 0) {
            return new Gpf_Data_RecordSet();
        }

        if ($numberOfTiers >= $maxTiers-2) {
            $lastTier = true;
        } else {
            $lastTier = false;
        }
        return parent::loadItems($userId, $lastTier);

    }
 private function updateCompressedCommissionsTask($recurrencePreset) {
     if (Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::PROCESSING_ENABLED) == Gpf::YES) {
         $this->insertCompressedCommissionsTask($recurrencePreset);
     } else {
         $this->removeCompressedCommissionsTask();
     }
 }
    /**
     * @service cronjob write
     * @param $fields
     */
    public function save(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        Gpf_Settings::set(Gpf_Settings_Gpf::CRON_RUN_INTERVAL, $form->getFieldValue(Gpf_Settings_Gpf::CRON_RUN_INTERVAL));
        $form->setInfoMessage($this->_("Cron runtime saved"));
        return $form;
    }
예제 #17
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::FIELD_NUMBER, Gpf_Settings::get(self::FIELD_NUMBER));
     $form->addField(self::SECRET_WORD, Gpf_Settings::get(self::SECRET_WORD));
     $form->addField(self::ALLOW_TEST_SALES, Gpf_Settings::get(self::ALLOW_TEST_SALES));
     return $form;
 }
예제 #18
0
 	public function addCommission(Pap_Contexts_Signup $signupContext) {
 	    if (($user = $signupContext->getUserObject()) == null) {
 	        return;
 	    } 
 	    
 	    $campaignId = Gpf_Settings::get(SignupActionCommissions_Config::AFTER_SIGNUP_ACTION_CAMPAIGNID);
 	    $actionCode = Gpf_Settings::get(SignupActionCommissions_Config::AFTER_SIGNUP_ACTION_CODE);
 	    
 	    if ($actionCode == '') {
 	        Gpf_Log::error('SignupActionCommissions plugin: No Action code set');
 	        return;
 	    }
        
 	    $saleTracker = new Pap_Tracking_ActionTracker();
 	    
        $action = $saleTracker->createAction($actionCode);
        $action->setAffiliateID($user->getId());    
        $action->setStatus($user->getStatus());
        $action->setOrderId(SignupActionCommissions_Config::DEFAULT_ORDER_ID);
        if ($campaignId != '') {
          $action->setCampaignID($campaignId);
        }
        try {
            $saleTracker->register();
        } catch (Gpf_Exception $e) {
            Gpf_Log::error('SignupActionCommissions plugin: '.$e->getMessage());
        }
        
 	}
    /**
     * checks for duplicate signups from same IP
     *
     * @return boolean
     */
    private function checkMultipleSignupsFromSameIp(Pap_Signup_SignupFormContext $context) {
        $checkIt = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME);
        if($checkIt != Gpf::YES) {
            return true;
        }

        $checkPeriod = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME);
        $checkAction = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME);
        if($checkPeriod == '' || $checkPeriod == '0' || !is_numeric($checkPeriod)) {
            return true;
        }
        if($checkAction != self::ACTION_DECLINE && $checkAction != self::ACTION_DONTSAVE) {
            return true;
        }

        $userObject = new Pap_Common_User();

        $recordsCount = $userObject->getNumberOfUsersFromSameIP($context->getIp(), $checkPeriod);
        if(($recordsCount > 0) && ($checkAction == self::ACTION_DONTSAVE)) {
            $context->getForm()->setErrorMessage($this->_("Not saved by fraud protection"));
            $context->setAllowSave(false);
            return false;
        } else if (($recordsCount > 0) && ($checkAction == self::ACTION_DECLINE)) {
            $context->getRow()->setStatus(Gpf_Db_User::DECLINED);
        }
        return true;
    }
예제 #20
0
    public function loadSettingsEmailNotifications(Gpf_Rpc_Form $form) {
        $form->setField(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY,
        Gpf_Settings::get(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY));

        $form->setField(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY_STATUS,
        Gpf_Settings::get(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY_STATUS));   
    }
예제 #21
0
    /**
     * @service tracking_mod_rewrite write
     * @param $fields
     */
    public function save(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        $prefix = $form->getFieldValue(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME);
        $separator = $form->getFieldValue(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME);
        $suffix = $form->getFieldValue(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME);
        $htaccessCode = $this->generateHtaccessCode($prefix, $separator, $suffix);

        if($separator == '') {
        	$form->setErrorMessage("Separator cannot be empty!");
        	return $form;
        }

        Gpf_Settings::set(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME, $prefix);
        Gpf_Settings::set(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME, $separator);
        Gpf_Settings::set(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME, $suffix);

        $form->setField("htaccess_code", $htaccessCode);

        $form->setInfoMessage($this->_("Changes saved"));

        Pap_Db_Table_CachedBanners::clearCachedBanners();

        return $form;
    }
 /**
  *
  * @return Gpf_SqlBuilder_SelectBuilder
  */
 private function getTables() {
     $select = new Gpf_SqlBuilder_SelectBuilder();
     $select->select->add('TABLE_NAME', 'name');
     $select->from->add("INFORMATION_SCHEMA.TABLES");
     $select->where->add("TABLE_SCHEMA", "=", Gpf_Settings::get(Gpf_Settings_Gpf::DB_DATABASE));
     return $select;
 }
예제 #23
0
    public function process(Pap_Common_TransactionCompoundContext $context) {

        $transaction = $context->getTransaction();
        $context->getContext()->debug("SubaffiliateFirstSaleBonus started");
        if($transaction->getTier() != 2) {
            $context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Not 2. tier");
            return;
        }

        $row = $this->getChildAffiliateInfo($transaction);

        $date = new Gpf_DateTime(time());
        $date->addDay(-Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::VALIDITY_DAYS));

        if(Gpf_Common_DateUtils::getDateTime($date->toTimeStamp()) > $row->get(Pap_Db_Table_Users::DATEINSERTED)) {
            $context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Date Inserted is older than defined days.");
            return;
        }

        if($this->getChildAffiliateTransactionsCount($row->get(Pap_Db_Table_Transactions::USER_ID)) > 1) {
            $context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Not user's first transaction.");
            return;
        }

        if(Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::BONUS_TYPE) == '%') {
            $transaction->setCommission($transaction->getCommission()+(Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::BONUS_AMOUNT)/100)*$transaction->getTotalCost());
        } else{
            $transaction->setCommission(Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::BONUS_AMOUNT)+$transaction->getCommission());
        }
        $context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Success.");
        return;
    }
    /**
     * @service fraud_protection write
     * @param $fields
     */
    public function save(Gpf_Rpc_Params $params) {
        $form = new Gpf_Rpc_Form($params);

        Gpf_Settings::set(Pap_Settings::BANNEDIPS_LIST_SIGNUPS,
        $form->getFieldValue(Pap_Settings::BANNEDIPS_LIST_SIGNUPS));

        Gpf_Settings::set(Pap_Settings::BANNEDIPS_SIGNUPS,
        $form->getFieldValue(Pap_Settings::BANNEDIPS_SIGNUPS));

        Gpf_Settings::set(Pap_Settings::BANNEDIPS_SIGNUPS_ACTION,
        $form->getFieldValue(Pap_Settings::BANNEDIPS_SIGNUPS_ACTION));

        Gpf_Settings::set(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME,
        $form->getFieldValue(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME));

        Gpf_Settings::set(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME,
        $form->getFieldValue(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME));

        Gpf_Settings::set(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME,
        $form->getFieldValue(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME));

        Gpf_Plugins_Engine::extensionPoint('FraudProtectionSignupsForm.save', $form);

        $form->setInfoMessage($this->_("Fraud protections saved"));
        return $form;
    }
예제 #25
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::PARAM_NAME, Gpf_Settings::get(self::PARAM_NAME));
     $form->addField(self::DISCOUNT_TAX, Gpf_Settings::get(self::DISCOUNT_TAX));
     $form->addField(self::DUTY_TAX, Gpf_Settings::get(self::DUTY_TAX));
     $form->addField(self::FREIGHT_TAX, Gpf_Settings::get(self::FREIGHT_TAX));
     return $form;
 }
예제 #26
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::CUSTOM_SEPARATOR, Gpf_Settings::get(self::CUSTOM_SEPARATOR));
     $form->addField(self::MERCHANT_USERNAME, Gpf_Settings::get(self::MERCHANT_USERNAME));
     $form->addField(self::MERCHANT_PASSWORD, Gpf_Settings::get(self::MERCHANT_PASSWORD));
     $form->addField(self::MERCHANT_IDENTIFIER, Gpf_Settings::get(self::MERCHANT_IDENTIFIER));
     return $form;
 }
 private function deleteLoginshistory()
 {
     $delete = new Gpf_SqlBuilder_DeleteBuilder();
     $delete->from->add(Gpf_Db_Table_LoginsHistory::getName());
     $delete->where->add(Gpf_Db_Table_LoginsHistory::LAST_REQUEST, '<', $this->getLastDate(Gpf_Settings::get(Gpf_Settings_Gpf::AUTO_DELETE_LOGINSHISTORY))->toDateTime());
     $delete->limit->set('', Gpf_Log_DeleteTaskBase::DELETE_LIMIT);
     return $delete->delete();
 }
예제 #28
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::CUSTOM_NUMBER, Gpf_Settings::get(self::CUSTOM_NUMBER));
     $form->addField(self::CUSTOM_SEPARATOR, Gpf_Settings::get(self::CUSTOM_SEPARATOR));
     $form->addField(self::DISCOUNT_TAX, Gpf_Settings::get(self::DISCOUNT_TAX));
     $form->addField(self::DISCOUNT_FEE, Gpf_Settings::get(self::DISCOUNT_FEE));
     return $form;
 }
 protected function validateRefid(Gpf_DbEngine_Row $row) {
     if ($row->get(Pap_Db_Table_Users::TYPE) == Pap_Application::ROLETYPE_AFFILIATE &&
     !$this->codeValidator->validate($row->get(Pap_Db_Table_Users::REFID))) {
         throw new Gpf_DbEngine_Row_ConstraintException(Pap_Db_Table_Users::REFID,
         $this->_('Refid must be in format "%s". Format definition: {9} - will be replaced by any character in range [0-9], {z} - will be replaced by any character in range [a-z], {Z} - will be replaced by any character in range [A-Z], {X} - will be replaced by any character in range [0-9a-zA-Z], all other characters will be unchanged. Example of good format is e.g. {ZZZ}-{XXXXX}-{999}',
         Gpf_Settings::get(CustomRefid_Config::CUSTOM_REFID_FORMAT)));
     }
 }
예제 #30
0
 /**
  * @anonym
  * @service custom_separator read
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addField(self::CUSTOM_FIELD_NUMBER, Gpf_Settings::get(self::CUSTOM_FIELD_NUMBER));
     $form->addField(self::SECURITY_CODE, Gpf_Settings::get(self::SECURITY_CODE));
     $form->addField(self::ALLOW_TEST_SALES, Gpf_Settings::get(self::ALLOW_TEST_SALES));
     $form->addField(self::DIFF_RECURRING_COMMISSIONS, Gpf_Settings::get(self::DIFF_RECURRING_COMMISSIONS));
     return $form;
 }