当前位置: 首页>>代码示例>>PHP>>正文


PHP PayPal::raiseError方法代码示例

本文整理汇总了PHP中PayPal::raiseError方法的典型用法代码示例。如果您正苦于以下问题:PHP PayPal::raiseError方法的具体用法?PHP PayPal::raiseError怎么用?PHP PayPal::raiseError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PayPal的用法示例。


在下文中一共展示了PayPal::raiseError方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPayPalCertificateFile

 /**
  * Returns the PayPal public certificate filename.
  *
  * @param string The environment to get the certificate for.
  * @return mixed The path and file of the certificate file, or a PayPal error object on failure.
  */
 function getPayPalCertificateFile($environment)
 {
     $package_root = PayPal::getPackageRoot();
     $cert = $package_root . '/cert/' . strtolower($environment) . '.paypal.com.pem';
     if (@(include "{$package_root}/conf/paypal-sdk.php")) {
         if (isset($__PP_CONFIG['paypal_cert_file']) && !empty($__PP_CONFIG['paypal_cert_file'])) {
             $cert = $__PP_CONFIG['paypal_cert_file'][$environment];
         }
     }
     if (!file_exists($cert)) {
         return PayPal::raiseError("Could not file Paypal public Certificate file '{$cert}'");
     }
     return $cert;
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:20,代码来源:EWPServices.php

示例2: getTypeList

 /**
  * Get information describing all types provided by the SDK.
  * @static
  */
 function getTypeList()
 {
     $root_dir = PayPal::getPackageRoot();
     $types = "{$root_dir}/Type/*.php";
     $files = glob($types);
     if (count($files) < 2) {
         return PayPal::raiseError("Types not found in package! (Looked for '{$types}')");
     }
     $retval = array();
     foreach ($files as $type_files) {
         $retval[] = basename(substr($type_files, 0, strpos($type_files, '.')));
     }
     return $retval;
 }
开发者ID:jabouzi,项目名称:paypal,代码行数:18,代码来源:PayPal.php

示例3: date

 /**
  * Gets the PEAR Log object to use.
  *
  * @return Log  A Log object, either provided by the user or
  *              created by this function.
  */
 function &getLogger()
 {
     if (!$this->_logger) {
         $file = $this->_logDir . '/' . date('Ymd') . '.PayPal.log';
         if (is_link($file) || file_exists($file) && !is_writable($file)) {
             // Don't overwrite symlinks.
             return PayPal::raiseError('bad logfile');
         }
         $this->_logger =& Log::singleton('file', $file, $this->_profile->getAPIUsername(), array('append' => true));
     }
     return $this->_logger;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:18,代码来源:CallerServices.php

示例4: validate

 /**
  * Validates the profile data currently loaded before use.
  *
  * @return mixed true if the data is valid, or a PayPal_Error object on failure.
  */
 function validate()
 {
     // Either certificate or signature or UNI pay is required
     if (empty($this->_subject)) {
         if (empty($this->_username) || empty($this->_password) || empty($this->_certificateFile) && empty($this->_signature) || empty($this->_environment)) {
             return PayPal::raiseError("API Username, Password, Certificate File and Environment must all be set");
         }
         if (!empty($this->_certificateFile) && !file_exists($this->_certificateFile)) {
             return PayPal::raiseError("Could not find certificate file '{$this->_certificateFile}'");
         }
         if (!in_array(strtolower($this->_environment), $this->_validEnvironments, true)) {
             return PayPal::raiseError("Environment '{$this->_environment}' is not a valid environment.");
         }
     }
     return true;
 }
开发者ID:AGProjects,项目名称:cdrtool,代码行数:21,代码来源:API.php

示例5: setPrivateKeyFile

 /**
  * Set the Merchant private key file
  *
  * @param string The Merchant Private Key File
  * @return mixed True on success, a PayPal error object on faliure
  */
 function setPrivateKeyFile($filename)
 {
     if (!file_exists($filename)) {
         return PayPal::raiseError("The private key '{$filename}' does not exist");
     }
     $this->_privateKeyFile = $filename;
     return true;
 }
开发者ID:jabouzi,项目名称:paypal,代码行数:14,代码来源:EWP.php

示例6: setEnvironment

 /**
  * Set the environment associated with this profile.
  *
  * @param string True on success, a Paypal error object on failure
  */
 function setEnvironment($environment)
 {
     $environment = strtolower($environment);
     $envs = $this->getValidEnvironments();
     if (PayPal::isError($envs)) {
         return $envs;
     }
     if (in_array($environment, $envs)) {
         $this->_environment = $environment;
         return true;
     }
     return PayPal::raiseError("Invalid Environment Specified");
 }
开发者ID:nidhhoggr,项目名称:mycoachingoffice,代码行数:18,代码来源:Profile.php

示例7: validate

 /**
  * Validates the profile data currently loaded before use.
  *
  * @return mixed true if the data is valid, or a PayPal_Error object on failure.
  */
 function validate()
 {
     // certificate or signature or UNI pay op permissioning is required
     if (empty($this->_subject) && (empty($this->_authSignature) && empty($this->_authToken) && empty($this->_authTimestamp))) {
         if (empty($this->_username) || empty($this->_password) || empty($this->_certificateFile) && empty($this->_signature) || empty($this->_environment)) {
             return PayPal::raiseError("API Username, Password, Certificate File and Environment must all be set or auth token,auth signature and auth timestamp must be set");
         }
         if (!empty($this->_certificateFile) && !file_exists($this->_certificateFile)) {
             return PayPal::raiseError("Could not find certificate file '{$this->_certificateFile}'");
         }
         if (!in_array(strtolower($this->_environment), $this->_validEnvironments, true)) {
             return PayPal::raiseError("Environment '{$this->_environment}' is not a valid environment.");
         }
     }
     return true;
 }
开发者ID:nidhhoggr,项目名称:mycoachingoffice,代码行数:21,代码来源:API.php

示例8:

 function &getInstance($params)
 {
     return PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:4,代码来源:Handler.php

示例9: validateParams

 function validateParams()
 {
     if (!isset($this->_params['path'])) {
         return PayPal::raiseError("You must provide the 'path' parameter for this handler");
     }
     if (file_exists($this->_params['path']) && is_dir($this->_params['path'])) {
         return true;
     }
     return false;
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:10,代码来源:File.php

示例10: _getHandlerPaths

/**
 * Returns an instance of the specified handler for use
 *
 * @internal
 * @param string The name of the handler (i.e. 'File', 'Array)
 * @param array An array of parameters for the specified handler
 * @return object A new instance of the Handler or a PayPal error object on failure
 */
function &_getHandlerInstance($handler_name, $handler_params)
{
    $handler_paths = _getHandlerPaths();
    $handler_classname = "ProfileHandler_{$handler_name}";
    _loadProfileHandlerClasses($handler_paths, $handler_name);
    if (!class_exists($handler_classname)) {
        return PayPal::raiseError("Could not load handler '{$handler_name}'");
    }
    $inst = new $handler_classname($handler_params);
    return $inst;
}
开发者ID:AGProjects,项目名称:cdrtool,代码行数:19,代码来源:functions.inc.php


注:本文中的PayPal::raiseError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。