本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例8:
function &getInstance($params)
{
return PayPal::raiseError("Cannot call this method from the base ProfileHandler class");
}
示例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;
}
示例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;
}