本文整理汇总了PHP中c_ws_plugin__s2member_utils_logs类的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_logs类的具体用法?PHP c_ws_plugin__s2member_utils_logs怎么用?PHP c_ws_plugin__s2member_utils_logs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了c_ws_plugin__s2member_utils_logs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: google_return
/**
* Handles Google Return URL processing.
*
* @package s2Member\Google
* @since 131123
*
* @attaches-to ``add_action("init");``
*
* @return null Or exits script execution after redirection.
*/
public static function google_return()
{
global $current_site, $current_blog;
if (!empty($_GET["s2member_pro_google_return"]) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_google_merchant_id"]) {
$google["s2member_log"][] = "Return URL processed on: " . date("D M j, Y g:i:s a T");
$google["s2member_log"][] = "Piping through s2Member's core/standard PayPal processor with `proxy_use` ( `ty-email` ).";
$google["s2member_log"][] = "Please check PayPal RTN logs for further processing details.";
$rtn_q = "&s2member_paypal_proxy=google&s2member_paypal_proxy_use=standard-emails,ty-email";
if (!empty($_GET["s2member_pro_google_return_success"])) {
$rtn_q .= "&s2member_paypal_return_success=" . rawurlencode(trim(stripslashes($_GET["s2member_pro_google_return_success"])));
}
$rtn_r = home_url("/?s2member_pro_google_return&s2member_paypal_return=1" . $rtn_q);
$rtn_r = c_ws_plugin__s2member_utils_urls::add_s2member_sig($rtn_r, "s2member_paypal_proxy_verification");
$google["s2member_log"][] = $rtn_r;
wp_redirect($rtn_r);
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . @$_SERVER["HTTP_USER_AGENT"];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? "google-rtn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "google-rtn.log";
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($google, true)) . "\n\n", FILE_APPEND);
}
}
}
exit;
// Exit now.
}
}
开发者ID:codeforest,项目名称:s2member-pro,代码行数:42,代码来源:google-return-in.inc.php
示例2: http_api_debug
/**
* Logs HTTP communication (if enabled).
*
* @package s2Member\Utilities
* @since 120212
*/
public static function http_api_debug($response = NULL, $state = NULL, $class = NULL, $args = NULL, $url = NULL)
{
if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
return;
}
// Logging is NOT enabled in this case.
$is_s2member = !empty($args['s2member']) || strpos($url, 's2member') !== FALSE ? TRUE : FALSE;
if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs_extensive'] && !$is_s2member) {
return;
}
// Extensive logging is NOT enabled in this case.
global $current_site, $current_blog;
// For Multisite support.
$http_api_debug = array('state' => $state, 'transport_class' => $class, 'args' => $args, 'url' => $url, 'response' => $response);
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\n" . 'User-Agent: ' . $_SERVER['HTTP_USER_AGENT'];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? 'http-api-debug-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'http-api-debug.log';
$http_api_debug_conceal_private_info = c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($http_api_debug, TRUE));
if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs_extensive']) {
file_put_contents($logs_dir . '/wp-' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
}
if ($is_s2member) {
// Log s2Member HTTP connections separately.
file_put_contents($logs_dir . '/s2-' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
}
}
}
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:39,代码来源:utils-logs.inc.php
示例3: http_api_debug
/**
* Logs HTTP communication (if enabled).
*
* @package s2Member\Utilities
* @since 120212
*
* @return null Nothing.
*/
public static function http_api_debug($response = NULL, $state = NULL, $class = NULL, $args = NULL, $url = NULL)
{
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
return;
}
// Logging is NOT enabled in this case.
$is_s2member = !empty($args["s2member"]) || strpos($url, "s2member") !== false ? true : false;
if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs_extensive"] && !$is_s2member) {
return;
}
// Extensive logging is NOT enabled in this case.
global $current_site, $current_blog;
$http_api_debug = array("state" => $state, "transport_class" => $class, "args" => $args, "url" => $url, "response" => $response);
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . $_SERVER["HTTP_USER_AGENT"];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? "http-api-debug-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "http-api-debug.log";
$http_api_debug_conceal_private_info = c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($http_api_debug, true));
if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs_extensive"]) {
file_put_contents($logs_dir . "/wp-" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
}
if ($is_s2member) {
// Log s2Member HTTP connections separately.
file_put_contents($logs_dir . "/s2-" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . $http_api_debug_conceal_private_info . "\n\n", FILE_APPEND);
}
}
}
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:40,代码来源:utils-logs.inc.php
示例4: log_entry
/**
* Logs an entry.
*
* @since 130315
* @package s2Member\Utilities
*
* @param string $slug The file name; i.e., a slug.
* e.g., `mailchimp-api`, `s2-http-api-debug`.
*
* @param mixed $data The data to log.
*/
public static function log_entry($slug, $data)
{
if (!($slug = trim((string) $slug))) {
return;
}
// Not possible.
if (!$data) {
return;
}
// Nothing to log.
if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
return;
}
// Nothing to do; logging not enabled right now.
if (!is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
return;
}
// Log directory does not exist at this time.
if (!is_writable($logs_dir)) {
return;
}
// Not writable.
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = '';
// Initialize.
if (is_multisite() && !is_main_site()) {
// Child blog in a multisite network?
$log4 .= $GLOBALS['current_blog']->domain . $GLOBALS['current_blog']->path . "\n";
}
$log4 .= @$_SERVER['HTTP_HOST'] . @$_SERVER['REQUEST_URI'] . "\n";
$log4 .= 'User-Agent: ' . @$_SERVER['HTTP_USER_AGENT'];
$log2 = $slug . '-api.log';
// Initialize.
if (is_multisite() && !is_main_site()) {
// Child blog in a multisite network?
$log2 = $slug . '-api-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', $GLOBALS['current_blog']->domain . $GLOBALS['current_blog']->path), '-') . '.log';
}
c_ws_plugin__s2member_utils_logs::archive_oversize_log_files();
file_put_contents($logs_dir . '/' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(print_r($data, TRUE)) . "\n\n", FILE_APPEND);
// Append to an existing log file; if exists.
}
开发者ID:adnandot,项目名称:intenseburn,代码行数:54,代码来源:utils-logs.inc.php
示例5: clickbank_notify
//.........这里部分代码省略.........
$ipn['s2member_paypal_proxy_use'] = 'standard-emails';
$ipn['s2member_paypal_proxy_verification'] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();
c_ws_plugin__s2member_utils_urls::remote(home_url('/?s2member_paypal_notify=1'), $ipn, array('timeout' => 20));
} else {
if (preg_match('/^(?:TEST_)?(?:RFND|CGBK|INSF)$/i', $clickbank['ctransaction'])) {
$clickbank['s2member_log'][] = 'ClickBank transaction identified as ( `RFND|CGBK|INSF` ).';
$clickbank['s2member_log'][] = 'IPN reformulated. Piping through s2Member\'s core/standard PayPal processor as `payment_status` ( `refunded|reversed` ).';
$clickbank['s2member_log'][] = 'Please check PayPal IPN logs for further processing details.';
$processing = $processed = TRUE;
$ipn = array();
// Reset.
$ipn['payment_status'] = preg_match('/^(?:TEST_)?RFND$/', $clickbank['ctransaction']) ? 'refunded' : 'reversed';
$ipn['parent_txn_id'] = preg_match('/^RECURRING$/i', $clickbank['cprodtype']) && $s2vars['s2_subscr_id'] ? $s2vars['s2_subscr_id'] : $clickbank['ctransreceipt'];
$ipn['custom'] = $s2vars['s2_custom'];
$ipn['mc_fee'] = '-' . number_format('0.00', 2, '.', '');
$ipn['mc_gross'] = '-' . number_format(abs($clickbank['corderamount']) / 100, 2, '.', '');
$ipn['mc_currency'] = strtoupper($clickbank['ccurrency']);
$ipn['tax'] = '-' . number_format('0.00', 2, '.', '');
$ipn['payer_email'] = $clickbank['ccustemail'];
$ipn['first_name'] = ucwords(strtolower($clickbank['ccustfirstname']));
$ipn['last_name'] = ucwords(strtolower($clickbank['ccustlastname']));
$ipn['option_name1'] = $s2vars['s2_referencing'] ? 'Referencing Customer ID' : 'Originating Domain';
$ipn['option_selection1'] = $s2vars['s2_referencing'] ? $s2vars['s2_referencing'] : $_SERVER['HTTP_HOST'];
$ipn['option_name2'] = 'Customer IP Address';
$ipn['option_selection2'] = $s2vars['s2_customer_ip'];
$ipn['item_number'] = $s2vars['s2_invoice'];
$ipn['item_name'] = $s2vars['s2_desc'];
$ipn['s2member_paypal_proxy'] = 'clickbank';
$ipn['s2member_paypal_proxy_use'] = 'standard-emails';
$ipn['s2member_paypal_proxy_verification'] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();
c_ws_plugin__s2member_utils_urls::remote(home_url('/?s2member_paypal_notify=1'), $ipn, array('timeout' => 20));
}
}
}
}
if (preg_match('/^(?:TEST_)?(?:SALE|BILL)$/i', $clickbank['ctransaction']) && preg_match('/^RECURRING$/i', $clickbank['cprodtype']) && (preg_match('/^COMPLETED$/i', $clickbank['crebillstatus']) || $clickbank['cfuturepayments'] <= 0) && apply_filters('c_ws_plugin__s2member_pro_clickbank_notify_handles_completions', TRUE, get_defined_vars()) || preg_match('/^(?:TEST_)?CANCEL-REBILL$/i', $clickbank['ctransaction']) && preg_match('/^RECURRING$/i', $clickbank['cprodtype'])) {
$clickbank['s2member_log'][] = 'ClickBank transaction identified as ( `RECURRING/COMPLETED` or `CANCEL-REBILL` ).';
$clickbank['s2member_log'][] = 'IPN reformulated. Piping through s2Member\'s core/standard PayPal processor as `txn_type` ( `subscr_cancel` ).';
$clickbank['s2member_log'][] = 'Please check PayPal IPN logs for further processing details.';
$processing = $processed = TRUE;
$ipn = array();
// Reset.
$ipn['txn_type'] = 'subscr_cancel';
$ipn['subscr_id'] = $s2vars['s2_subscr_id'];
$ipn['custom'] = $s2vars['s2_custom'];
$ipn['period1'] = $s2vars['s2_p1'];
$ipn['period3'] = $s2vars['s2_p3'];
$ipn['payer_email'] = $clickbank['ccustemail'];
$ipn['first_name'] = ucwords(strtolower($clickbank['ccustfirstname']));
$ipn['last_name'] = ucwords(strtolower($clickbank['ccustlastname']));
$ipn['option_name1'] = $s2vars['s2_referencing'] ? 'Referencing Customer ID' : 'Originating Domain';
$ipn['option_selection1'] = $s2vars['s2_referencing'] ? $s2vars['s2_referencing'] : $_SERVER['HTTP_HOST'];
$ipn['option_name2'] = 'Customer IP Address';
$ipn['option_selection2'] = $s2vars['s2_customer_ip'];
$ipn['item_number'] = $s2vars['s2_invoice'];
$ipn['item_name'] = $s2vars['s2_desc'];
$ipn['s2member_paypal_proxy'] = 'clickbank';
$ipn['s2member_paypal_proxy_use'] = 'standard-emails';
$ipn['s2member_paypal_proxy_verification'] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();
c_ws_plugin__s2member_utils_urls::remote(home_url('/?s2member_paypal_notify=1'), $ipn, array('timeout' => 20));
}
if (empty($processed)) {
// If nothing was processed, here we add a message to the logs indicating the IPN was ignored.
$clickbank['s2member_log'][] = 'Ignoring this IPN request. The transaction does NOT require any action on the part of s2Member.';
}
} else {
$clickbank['s2member_log'][] = 'Unable to verify POST vars. This is most likely related to an invalid ClickBank configuration. Please check: s2Member → ClickBank Options.';
$clickbank['s2member_log'][] = 'If you\'re absolutely SURE that your ClickBank configuration is valid, you may want to run some tests on your server, just to be sure $_POST variables are populated, and that your server is able to connect to ClickBank over an HTTPS connection.';
$clickbank['s2member_log'][] = 's2Member uses the WP_Http class for remote connections; which will try to use cURL first, and then fall back on the FOPEN method when cURL is not available. On a Windows server, you may have to disable your cURL extension. Instead, set allow_url_fopen = yes in your php.ini file. The cURL extension (usually) does NOT support SSL connections on a Windows server.';
$clickbank['s2member_log'][] = var_export($_REQUEST, TRUE);
// Recording _POST + _GET vars for analysis and debugging.
}
/*
If debugging/logging is enabled; we need to append $clickbank to the log file.
Logging now supports Multisite Networking as well.
*/
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "\n" . 'User-Agent: ' . @$_SERVER['HTTP_USER_AGENT'];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? 'clickbank-ipn-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'clickbank-ipn.log';
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
file_put_contents($logs_dir . '/' . $log2, 'LOG ENTRY: ' . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($clickbank, TRUE)) . "\n\n", FILE_APPEND);
}
}
}
status_header(200);
// Send a 200 OK status header.
header('Content-Type: text/plain; charset=UTF-8');
// Content-Type text/plain with UTF-8.
while (@ob_end_clean()) {
}
// Clean any existing output buffers.
exit;
// Exit now.
}
}
开发者ID:SollyNZ,项目名称:damn-plugins,代码行数:101,代码来源:clickbank-notify-v2-1-in.inc.php
示例6: process_list_server_removals
/**
* Processes List Server removals for s2Member.
*
* @package s2Member\List_Servers
* @since 3.5
*
* @param str $role A WordPress Role ID/Name, such as `subscriber`, or `s2member_level1`.
* @param int|str $level A numeric s2Member Access Level number.
* @param str $login Username for the User.
* @param str $pass Plain Text Password for the User.
* @param str $email Email address for the User.
* @param str $fname First Name for the User.
* @param str $lname Last Name for the User.
* @param str $ip IP Address for the User.
* @param bool $opt_out Defaults to false; must be set to true. Indicates the User IS opting out.
* @param int|str $user_id A WordPress User ID, numeric string or integer.
* @return bool True if at least one List Server is processed successfully, else false.
*
* @todo Integrate {@link https://labs.aweber.com/docs/php-library-walkthrough AWeber's API}.
* @todo Add a separate option for mail debugging; or consolidate?
* @todo Integrate AWeber API (much like the MailChimp API).
*/
public static function process_list_server_removals($role = FALSE, $level = FALSE, $login = FALSE, $pass = FALSE, $email = FALSE, $fname = FALSE, $lname = FALSE, $ip = FALSE, $opt_out = FALSE, $user_id = FALSE)
{
global $current_site, $current_blog;
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_process_list_server_removals", get_defined_vars());
unset($__refs, $__v);
if (c_ws_plugin__s2member_list_servers::list_servers_integrated() && ($args = func_get_args()) && $role && is_string($role) && is_numeric($level) && $login && is_string($login) && is_string($pass = (string) $pass) && $email && is_string($email) && is_email($email) && is_string($fname = (string) $fname) && is_string($lname = (string) $lname) && is_string($ip = (string) $ip) && is_bool($opt_out = (bool) $opt_out) && $opt_out && $user_id && is_numeric($user_id) && is_object($user = new WP_User($user_id)) && !empty($user->ID)) {
$ccaps = implode(",", c_ws_plugin__s2member_user_access::user_access_ccaps($user));
$email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
c_ws_plugin__s2member_email_configs::email_config_release();
if (!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]) && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_mailchimp_list_ids"])) {
if (!class_exists("NC_MCAPI")) {
include_once dirname(dirname(__FILE__)) . "/externals/mailchimp/nc-mcapi.inc.php";
}
$mcapi = new NC_MCAPI($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"], true);
foreach (preg_split("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_mailchimp_list_ids"]) as $mailchimp_list) {
$mailchimp = array("function" => __FUNCTION__, "func_get_args" => $args, "api_removal_method" => "listUnsubscribe");
if ($mailchimp["list_id"] = trim(preg_replace("/\\:\\:.*\$/", "", $mailchimp_list))) {
if ($mailchimp["api_removal_response"] = $mcapi->{$mailchimp["api_removal_method"]}($mailchimp["list_id"], $email, $mailchimp["api_removal_delete_member"] = apply_filters("ws_plugin__s2member_mailchimp_removal_delete_member", false, get_defined_vars()), $mailchimp["api_removal_send_goodbye"] = apply_filters("ws_plugin__s2member_mailchimp_removal_send_goodbye", false, get_defined_vars()), $mailchimp["api_removal_send_notify"] = apply_filters("ws_plugin__s2member_mailchimp_removal_send_notify", false, get_defined_vars()))) {
// Send notification?
$mailchimp["api_removal_success"] = $removal_success = true;
}
// Flag indicating that we DO have a successful removal; affects the function's overall return value.
$mailchimp["api_removal_properties"] = $mcapi;
// Include API instance too; as it contains some additional information after each method is processed (need this in the logs).
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . $_SERVER["HTTP_USER_AGENT"];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? "mailchimp-api-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "mailchimp-api.log";
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($mailchimp, true)) . "\n\n", FILE_APPEND);
}
}
}
}
}
}
if (!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["getresponse_api_key"]) && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_getresponse_list_ids"])) {
foreach (preg_split("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_getresponse_list_ids"]) as $getresponse_list) {
$getresponse = array("function" => __FUNCTION__, "func_get_args" => $args, "api_method" => "get_contacts");
if ($getresponse["list_id"] = $getresponse["list"] = trim($getresponse_list)) {
$getresponse["api_headers"] = array("Content-Type" => "application/json");
$getresponse["api_params"] = array($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["getresponse_api_key"], array("campaigns" => array($getresponse["list_id"]), "email" => array("EQUALS" => $email)));
$getresponse["api_request"] = json_encode(array("method" => $getresponse["api_method"], "params" => $getresponse["api_params"], "id" => uniqid("", TRUE)));
if (is_object($getresponse["api_response"] = json_decode(c_ws_plugin__s2member_utils_urls::remote("https://api2.getresponse.com", $getresponse["api_request"], array("headers" => $getresponse["api_headers"])))) && empty($getresponse["api_response"]->error) && ($getresponse["api_response_contact_ids"] = array_keys((array) $getresponse["api_response"]->result)) && ($getresponse["api_response_contact_id"] = $getresponse["api_response_contact_ids"][0])) {
$getresponse["api_method"] = "delete_contact";
// Update method now.
$getresponse["api_headers"] = array("Content-Type" => "application/json");
$getresponse["api_params"] = array($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["getresponse_api_key"], array("contact" => $getresponse["api_response_contact_id"]));
$getresponse["api_request"] = json_encode(array("method" => $getresponse["api_method"], "params" => $getresponse["api_params"], "id" => uniqid("", TRUE)));
if (is_object($getresponse["api_response"] = json_decode(c_ws_plugin__s2member_utils_urls::remote("https://api2.getresponse.com", $getresponse["api_request"], array("headers" => $getresponse["api_headers"])))) && empty($getresponse["api_response"]->error) && $getresponse["api_response"]->result->deleted) {
$getresponse["api_success"] = $success = true;
}
}
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . $_SERVER["HTTP_USER_AGENT"];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? "getresponse-api-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "getresponse-api.log";
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($getresponse, true)) . "\n\n", FILE_APPEND);
}
}
}
}
}
}
if (!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_aweber_list_ids"])) {
foreach (preg_split("/[\r\n\t\\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_aweber_list_ids"]) as $aweber_list) {
//.........这里部分代码省略.........
开发者ID:donwea,项目名称:nhap.org,代码行数:101,代码来源:list-servers.inc.php
示例7: ccbill_notify
//.........这里部分代码省略.........
$ccbill["s2member_log"][] = "Please check PayPal IPN logs for further processing details.";
$processing = $processed = true;
$ipn = array();
// Reset.
$ipn["txn_type"] = "web_accept";
$ipn["txn_id"] = $ccbill["subscription_id"];
$ipn["custom"] = $ccbill["s2_custom"];
$ipn["mc_gross"] = number_format($ccbill["initialPrice"], 2, ".", "");
$ipn["mc_currency"] = c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_currency_code($ccbill["currencyCode"]);
$ipn["tax"] = number_format("0.00", 2, ".", "");
$ipn["payer_email"] = $ccbill["email"];
$ipn["first_name"] = $ccbill["customer_fname"];
$ipn["last_name"] = $ccbill["customer_lname"];
$ipn["option_name1"] = $ccbill["s2_referencing"] ? "Referencing Customer ID" : "Originating Domain";
$ipn["option_selection1"] = $ccbill["s2_referencing"] ? $ccbill["s2_referencing"] : $_SERVER["HTTP_HOST"];
$ipn["option_name2"] = "Customer IP Address";
$ipn["option_selection2"] = $ccbill["s2_customer_ip"];
$ipn["item_number"] = $ccbill["s2_invoice"];
$ipn["item_name"] = $ccbill["s2_desc"];
$ipn["s2member_paypal_proxy"] = "ccbill";
$ipn["s2member_paypal_proxy_use"] = "standard-emails";
$ipn["s2member_paypal_proxy_verification"] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();
c_ws_plugin__s2member_utils_urls::remote(home_url("/?s2member_paypal_notify=1"), $ipn, array("timeout" => 20));
} else {
if (!$ccbill["denialId"] && $ccbill["subscription_id"] && $ccbill["recurringPeriod"]) {
$ccbill["s2member_log"][] = "ccBill transaction identified as ( `RECURRING/SUBSCRIPTION` ).";
$ccbill["s2member_log"][] = "IPN reformulated. Piping through s2Member's core/standard PayPal processor as `txn_type` ( `subscr_signup` ).";
$ccbill["s2member_log"][] = "Please check PayPal IPN logs for further processing details.";
$processing = $processed = true;
$ipn = array();
// Reset.
$ipn["txn_type"] = "subscr_signup";
$ipn["subscr_id"] = $ccbill["subscription_id"];
$ipn["recurring"] = "1";
// Yes, recurring.
$ipn["txn_id"] = $ccbill["subscription_id"];
$ipn["custom"] = $ccbill["s2_custom"];
$ipn["period1"] = $ccbill["s2_p1"];
$ipn["period3"] = $ccbill["s2_p3"];
$ipn["mc_amount1"] = number_format($ccbill["initialPrice"], 2, ".", "");
$ipn["mc_amount3"] = number_format($ccbill["recurringPrice"], 2, ".", "");
$ipn["mc_gross"] = preg_match("/^[1-9]/", $ipn["period1"]) ? $ipn["mc_amount1"] : $ipn["mc_amount3"];
$ipn["mc_currency"] = c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_currency_code($ccbill["currencyCode"]);
$ipn["tax"] = number_format("0.00", 2, ".", "");
$ipn["payer_email"] = $ccbill["email"];
$ipn["first_name"] = $ccbill["customer_fname"];
$ipn["last_name"] = $ccbill["customer_lname"];
$ipn["option_name1"] = $ccbill["s2_referencing"] ? "Referencing Customer ID" : "Originating Domain";
$ipn["option_selection1"] = $ccbill["s2_referencing"] ? $ccbill["s2_referencing"] : $_SERVER["HTTP_HOST"];
$ipn["option_name2"] = "Customer IP Address";
$ipn["option_selection2"] = $ccbill["s2_customer_ip"];
$ipn["item_number"] = $ccbill["s2_invoice"];
$ipn["item_name"] = $ccbill["s2_desc"];
$ipn["s2member_paypal_proxy"] = "ccbill";
$ipn["s2member_paypal_proxy_use"] = "standard-emails";
$ipn["s2member_paypal_proxy_use"] .= $ipn["mc_gross"] > 0 ? ",subscr-signup-as-subscr-payment" : "";
$ipn["s2member_paypal_proxy_verification"] = c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen();
c_ws_plugin__s2member_utils_urls::remote(home_url("/?s2member_paypal_notify=1"), $ipn, array("timeout" => 20));
} else {
if (!$processed) {
// If nothing was processed, here we add a message to the logs indicating the IPN was ignored.
$ccbill["s2member_log"][] = "Ignoring this IPN request. The transaction does NOT require any action on the part of s2Member.";
}
}
}
} else {
$ccbill["s2member_log"][] = "Unable to verify POST vars. This is most likely related to an invalid ccBill configuration. Please check: s2Member → ccBill Options.";
$ccbill["s2member_log"][] = "If you're absolutely SURE that your ccBill configuration is valid, you may want to run some tests on your server, just to be sure \$_POST variables are populated, and that your server is able to connect to ccBill over an HTTPS connection.";
$ccbill["s2member_log"][] = "s2Member uses the WP_Http class for remote connections; which will try to use cURL first, and then fall back on the FOPEN method when cURL is not available. On a Windows server, you may have to disable your cURL extension. Instead, set allow_url_fopen = yes in your php.ini file. The cURL extension (usually) does NOT support SSL connections on a Windows server.";
$ccbill["s2member_log"][] = var_export($_REQUEST, true);
// Recording _POST + _GET vars for analysis and debugging.
}
/*
If debugging/logging is enabled; we need to append $ccbill to the log file.
Logging now supports Multisite Networking as well.
*/
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . @$_SERVER["HTTP_USER_AGENT"];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? "ccbill-ipn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "ccbill-ipn.log";
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info(var_export($ccbill, true)) . "\n\n", FILE_APPEND);
}
}
}
status_header(200);
// Send a 200 OK status header.
header("Content-Type: text/plain; charset=UTF-8");
// Content-Type text/plain with UTF-8.
while (@ob_end_clean()) {
}
// Clean any existing output buffers.
exit;
// Exit now.
}
}
开发者ID:codeforest,项目名称:s2member-pro,代码行数:101,代码来源:ccbill-notify-in.inc.php
示例8: paypal_payflow_api_response
/**
* Calls upon the PayPal PayFlow API, and returns the response.
*
* @package s2Member\PayPal
* @since 120514
*
* @param array $post_vars An array of variables to send through the PayPal PayFlow API call.
* @return array An array of variables returned by the PayPal PayFlow API.
*/
public static function paypal_payflow_api_response($post_vars = FALSE)
{
global $current_site, $current_blog;
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_paypal_payflow_api_response", get_defined_vars());
unset($__refs, $__v);
$url = "https://" . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "pilot-payflowpro.paypal.com" : "payflowpro.paypal.com");
$post_vars = apply_filters("ws_plugin__s2member_paypal_payflow_api_post_vars", $post_vars, get_defined_vars());
$post_vars = is_array($post_vars) ? $post_vars : array();
$post_vars["VERBOSITY"] = "HIGH";
$post_vars["USER"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_username"];
$post_vars["PARTNER"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_partner"];
$post_vars["VENDOR"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_vendor"];
$post_vars["PWD"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_password"];
foreach ($post_vars as $_key => &$_value) {
$_value = c_ws_plugin__s2member_paypal_utilities::paypal_payflow_api_nv_cleanup($_key, $_value);
}
unset($_key, $_value);
$input_time = date("D M j, Y g:i:s a T");
$nvp_post_vars = "";
foreach ($post_vars as $_key => $_value) {
$nvp_post_vars .= ($nvp_post_vars ? "&" : "") . $_key . "[" . strlen($_value) . "]=" . $_value;
}
unset($_key, $_value);
$nvp = trim(c_ws_plugin__s2member_utils_urls::remote($url, $nvp_post_vars, array("timeout" => 20, "headers" => array("Content-Type" => "text/namevalue"))));
$output_time = date("D M j, Y g:i:s a T");
wp_parse_str($nvp, $response);
$response = c_ws_plugin__s2member_utils_strings::trim_deep($response);
if ($response["RESULT"] !== "0") {
if (strlen($response["RESPMSG"])) {
/* translators: Exclude `%2$s`. These are English details returned by PayPal. Replace `%2$s` with: `Unable to process, please try again`, or something to that affect. Or, if you prefer, you could Filter ``$response["__error"]`` with `ws_plugin__s2member_paypal_payflow_api_response`. */
$response["__error"] = sprintf(_x('Error #%1$s. %2$s.', "s2member-front", "s2member"), $response["RESULT"], rtrim($response["RESPMSG"], "."));
} else {
$response["__error"] = _x("Error. Please contact Support for assistance.", "s2member-front", "s2member");
}
} else {
if (isset($response["TRXRESULT"]) && $response["TRXRESULT"] !== "0") {
if (strlen($response["TRXRESPMSG"])) {
/* translators: Exclude `%2$s`. These are English details returned by PayPal. Replace `%2$s` with: `Unable to process, please try again`, or something to that affect. Or, if you prefer, you could Filter ``$response["__error"]`` with `ws_plugin__s2member_paypal_payflow_api_response`. */
$response["__error"] = sprintf(_x('Error #%1$s. %2$s.', "s2member-front", "s2member"), $response["TRXRESULT"], rtrim($response["TRXRESPMSG"], "."));
} else {
$response["__error"] = _x("Error. Please contact Support for assistance.", "s2member-front", "s2member");
}
}
}
$logt = c_ws_plugin__s2member_utilities::time_details();
$logv = c_ws_plugin__s2member_utilities::ver_details();
$logm = c_ws_plugin__s2member_utilities::mem_details();
$log4 = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "\nUser-Agent: " . @$_SERVER["HTTP_USER_AGENT"];
$log4 = is_multisite() && !is_main_site() ? ($_log4 = $current_blog->domain . $current_blog->path) . "\n" . $log4 : $log4;
$log2 = is_multisite() && !is_main_site() ? "paypal-payflow-api-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-payflow-api.log";
if (isset($post_vars["ACCT"]) && strlen($post_vars["ACCT"]) > 4) {
$post_vars["ACCT"] = str_repeat("*", strlen($post_vars["ACCT"]) - 4) . substr($post_vars["ACCT"], -4);
}
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
if (is_writable($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files()) {
if ($log = "-------- Input vars: ( " . $input_time . " ) --------\n" . $nvp_post_vars . "\n" . var_export($post_vars, true) . "\n") {
if ($log .= "-------- Output string/vars: ( " . $output_time . " ) --------\n" . $nvp . "\n" . var_export($response, true)) {
file_put_contents($logs_dir . "/" . $log2, "LOG ENTRY: " . $logt . "\n" . $logv . "\n" . $logm . "\n" . $log4 . "\n" . c_ws_plugin__s2member_utils_logs::conceal_private_info($log) . "\n\n", FILE_APPEND);
}
}
}
}
}
return apply_filters("ws_plugin__s2member_paypal_payflow_api_response", c_ws_plugin__s2member_paypal_utilities::_paypal_payflow_api_response_filters($response), get_defined_vars());
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:78,代码来源:paypal-utilities.inc.php
示例9: unsubscribe
/**
* Unsubscribe.
*
* @since 141004
* @package s2Member\List_Servers
*
* @param array $args Input arguments.
*
* @return bool True if successful.
*/
public static function unsubscribe($args)
{
if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['aweber_api_type'] === 'email') {
return c_ws_plugin__s2member_aweber_e::unsubscribe($args);
}
if (!($args = self::validate_args($args))) {
return FALSE;
}
// Invalid args.
if (!$args->opt_out) {
// Double check.
return FALSE;
}
// Must say explicitly.
if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['aweber_api_key']) {
return FALSE;
}
// Not possible.
if (empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $args->level . '_aweber_list_ids'])) {
return FALSE;
}
// No list configured at this level.
if (!($aw_api = self::aw_api()) || !@$aw_api->___account->id) {
return FALSE;
}
// Unable to acquire API instance.
$aw_level_list_ids = $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $args->level . '_aweber_list_ids'];
foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', $aw_level_list_ids, NULL, PREG_SPLIT_NO_EMPTY) as $_aw_list) {
$_aw = array('args' => $args, 'function' => __FUNCTION__, 'list' => trim($_aw_list), 'list_id' => trim($_aw_list), 'api_method' => 'listUnsubscribe');
if (!$_aw['list'] || !$_aw['list_id']) {
continue;
}
// List missing.
try {
if (self::count($_aw['foundLists'] = $aw_api->___account->lists->find(array('name' => $_aw['list_id'])))) {
if ($_aw['listUrl'] = '/accounts/' . $aw_api->___account->id . '/lists/' . $_aw['foundLists'][0]->id) {
if ($_aw['list'] = $aw_api->___account->loadFromUrl($_aw['listUrl'])) {
$_aw['findSubscriber'] = array('email' => $args->email, 'status' => 'subscribed');
if (self::count($_aw['foundSubscribers'] = $_aw['list']->subscribers->find($_aw['findSubscriber']))) {
/** @var AWeberEntry $_existing_subscriber */
$_existing_subscriber = $_aw['foundSubscribers'][0];
$_existing_subscriber->status = 'unsubscribed';
// Unsubscribe.
if ($_existing_subscriber->save() && ($_aw['subscriber'] = $_existing_subscriber)) {
$_aw['api_success'] = $success = TRUE;
}
// Flag this as `TRUE`; assists with return value below.
unset($_existing_subscriber);
// Housekeeping.
}
}
}
}
} catch (Exception $exception) {
$_aw['exception'] = $exception;
}
c_ws_plugin__s2member_utils_logs::log_entry('aweber-api', $_aw);
}
unset($_aw_list, $_aw);
// Just a little housekeeping.
return !empty($success);
// If one suceeds.
}
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:73,代码来源:aweb |
请发表评论