本文整理汇总了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类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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.
}
示例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.
}
}
示例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) {
//.........这里部分代码省略.........
示例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.
}
}
示例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());
}
示例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.
}
示例10: alipay_return
/**
* Handles AliPay Return URL processing.
*
* @package s2Member\AliPay
* @since 1.5
*
* @attaches-to ``add_action("init");``
*
* @return null Or exits script execution after redirection.
*/
public static function alipay_return()
{
global $current_site, $current_blog;
if (!empty($_GET["s2member_pro_alipay_return"]) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_alipay_seller_email"]) {
if (is_array($alipay = c_ws_plugin__s2member_pro_alipay_utilities::alipay_postvars()) && ($_alipay = $alipay)) {
$alipay["s2member_log"][] = "Return-Data received on: " . date("D M j, Y g:i:s a T");
$alipay["s2member_log"][] = "s2Member POST vars verified through a POST back to AliPay.";
if (preg_match("/^(TRADE_FINISHED|TRADE_SUCCESS)\$/i", $alipay["trade_status"]) && !$alipay["refund_status"]) {
$alipay["s2member_log"][] = "AliPay transaction identified as ( `TRADE_FINISHED|TRADE_SUCCESS` ).";
$alipay["s2member_log"][] = "Return-Data reformulated. Piping through s2Member's core/standard PayPal processor as `txn_type` ( `web_accept` ).";
$alipay["s2member_log"][] = "Please check PayPal RTN logs for further processing details.";
list($alipay["invoice"], $alipay["item_number"], $alipay["referencing"], $alipay["customer_ip"]) = preg_split("/~/", $alipay["out_trade_no"]);
list($alipay["first_name"], $alipay["last_name"]) = preg_split("/@/", $alipay["buyer_email"], 2);
$rtn = array();
$rtn["txn_type"] = "web_accept";
$rtn["txn_id"] = $alipay["trade_no"];
$rtn["custom"] = $alipay["extra_common_param"];
$rtn["mc_gross"] = number_format($alipay["total_fee"], 2, ".", "");
$rtn["mc_currency"] = "CNY";
// Yuan.
$rtn["tax"] = "0";
// No tax.
$rtn["payer_email"] = $alipay["buyer_email"];
$rtn["first_name"] = $alipay["first_name"];
$rtn["last_name"] = $alipay["last_name"];
$rtn["option_name1"] = $alipay["referencing"] ? "Referencing Customer ID" : "Originating Domain";
$rtn["option_selection1"] = $alipay["referencing"] ? $alipay["referencing"] : $_SERVER["HTTP_HOST"];
$rtn["option_name2"] = "Customer IP Address";
$rtn["option_selection2"] = $alipay["customer_ip"];
$rtn["item_number"] = $alipay["item_number"];
$rtn["item_name"] = $alipay["body"];
$rtn_q = "&s2member_paypal_proxy=alipay&s2member_paypal_proxy_use=standard-emails";
if (!empty($_GET["s2member_pro_alipay_return_success"])) {
$rtn_q .= "&s2member_paypal_return_success=" . rawurlencode(trim(stripslashes($_GET["s2member_pro_alipay_return_success"])));
}
$rtn_r = add_query_arg(urlencode_deep($rtn), site_url("/?s2member_pro_alipay_return&s2member_paypal_return=1" . $rtn_q));
$rtn_r = c_ws_plugin__s2member_utils_urls::add_s2member_sig($rtn_r, "s2member_paypal_proxy_verification");
$alipay["s2member_log"][] = $rtn_r;
wp_redirect($rtn_r);
} else {
$alipay["s2member_log"][] = "Unexpected status. The AliPay status did not match a required action.";
$alipay["s2member_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
echo '<script type="text/javascript">' . "\n";
echo "alert('" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("ERROR: Unexpected status. Please contact Support for assistance.\n\nThe AliPay status did NOT match a required action.", "s2member-front", "s2member")) . "');" . "\n";
echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(home_url("/")) . "';";
echo '</script>' . "\n";
}
} else {
$alipay["s2member_log"][] = "Unable to verify POST vars. This is most likely related to an invalid AliPay configuration. Please check: s2Member -› AliPay Options.";
$alipay["s2member_log"][] = "If you're absolutely SURE that your AliPay 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 AliPay over an HTTPS connection.";
$alipay["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.";
$alipay["s2member_log"][] = var_export($_REQUEST, true);
// Recording _POST + _GET vars for analysis and debugging.
$alipay["s2member_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
echo '<script type="text/javascript">' . "\n";
echo "alert('" . c_ws_plugin__s2member_utils_strings::esc_js_sq(_x("ERROR: Unable to verify POST vars. Please contact Support for assistance.\n\nThis is most likely related to an invalid AliPay configuration. If you are the site owner, please check: s2Member -› AliPay Options.", "s2member-front", "s2member")) . "');" . "\n";
echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq(home_url("/")) . "';";
echo '</script>' . "\n";
}
$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() ? "alipay-rtn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "alipay-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($alipay, true)) . "\n\n", FILE_APPEND);
}
}
}
exit;
// Exit now.
}
}
示例11: authnet_arb_service
//.........这里部分代码省略.........
/**/
$ipn["custom"] = $authnet["arb_ipn_signup_vars"]["custom"];
/**/
$ipn["period1"] = $authnet["arb_ipn_signup_vars"]["period1"];
$ipn["period3"] = $authnet["arb_ipn_signup_vars"]["period3"];
/**/
$ipn["payer_email"] = $authnet["arb_ipn_signup_vars"]["payer_email"];
$ipn["first_name"] = $authnet["arb_ipn_signup_vars"]["first_name"];
$ipn["last_name"] = $authnet["arb_ipn_signup_vars"]["last_name"];
/**/
$ipn["option_name1"] = $authnet["arb_ipn_signup_vars"]["option_name1"];
$ipn["option_selection1"] = $authnet["arb_ipn_signup_vars"]["option_selection1"];
/**/
$ipn["option_name2"] = $authnet["arb_ipn_signup_vars"]["option_name2"];
$ipn["option_selection2"] = $authnet["arb_ipn_signup_vars"]["option_selection2"];
/**/
$ipn["item_number"] = $authnet["arb_ipn_signup_vars"]["item_number"];
$ipn["item_name"] = $authnet["arb_ipn_signup_vars"]["item_name"];
/**/
$ipn_q = "&s2member_paypal_proxy=authnet&s2member_paypal_proxy_use=pro-emails";
$ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode(c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen());
/**/
c_ws_plugin__s2member_utils_urls::remote(site_url("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
} else {
if (preg_match("/^(suspended|canceled|terminated)\$/i", $authnet["subscription_status"])) {
$authnet["s2member_log"][] = "Authorize.Net® ARB/IPN processed on: " . date("D M j, Y g:i:s a T");
/**/
$authnet["s2member_log"][] = "Authorize.Net® transaction identified as ( `SUBSCRIPTION " . strtoupper($authnet["subscription_status"]) . "` ).";
$authnet["s2member_log"][] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `txn_type` ( `subscr_cancel` ).";
$authnet["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"] = $authnet["arb_ipn_signup_vars"]["subscr_id"];
/**/
$ipn["custom"] = $authnet["arb_ipn_signup_vars"]["custom"];
/**/
$ipn["period1"] = $authnet["arb_ipn_signup_vars"]["period1"];
$ipn["period3"] = $authnet["arb_ipn_signup_vars"]["period3"];
/**/
$ipn["payer_email"] = $authnet["arb_ipn_signup_vars"]["payer_email"];
$ipn["first_name"] = $authnet["arb_ipn_signup_vars"]["first_name"];
$ipn["last_name"] = $authnet["arb_ipn_signup_vars"]["last_name"];
/**/
$ipn["option_name1"] = $authnet["arb_ipn_signup_vars"]["option_name1"];
$ipn["option_selection1"] = $authnet["arb_ipn_signup_vars"]["option_selection1"];
/**/
$ipn["option_name2"] = $authnet["arb_ipn_signup_vars"]["option_name2"];
$ipn["option_selection2"] = $authnet["arb_ipn_signup_vars"]["option_selection2"];
/**/
$ipn["item_number"] = $authnet["arb_ipn_signup_vars"]["item_number"];
$ipn["item_name"] = $authnet["arb_ipn_signup_vars"]["item_name"];
/**/
$ipn_q = "&s2member_paypal_proxy=authnet&s2member_paypal_proxy_use=pro-emails";
$ipn_q .= "&s2member_paypal_proxy_verification=" . urlencode(c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen());
/**/
c_ws_plugin__s2member_utils_urls::remote(site_url("/?s2member_paypal_notify=1" . $ipn_q), $ipn, array("timeout" => 20));
} else {
if (!$processed) {
/* If nothing was processed, here we add a message to the logs indicating the status; which is being ignored by s2Member. */
$authnet["s2member_log"][] = "Ignoring this ARB/Status ( `" . $authnet["subscription_status"] . "` ). It does NOT require any action on the part of s2Member.";
}
}
}
/**/
$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() ? "authnet-arb-ipn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "authnet-arb-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, $logv . "\n" . $logm . "\n" . $log4 . "\n" . var_export($authnet, true) . "\n\n", FILE_APPEND);
}
}
}
}
}
}
/**/
update_user_option($user_id, "s2member_last_status_scan", time());
/**/
if ($counter >= $per_process) {
/* Only this many. */
break;
}
/* Break the loop now. */
}
}
}
}
/**/
return;
/* Return for uniformity. */
}
示例12: paypal_notify
//.........这里部分代码省略.........
}
}
}
}
}
}
}
}
}
}
}
} else {
unset($__refs, $__v);
}
// Else a custom conditional has been applied by Filters.
} else {
if (!empty($paypal['txn_type']) && preg_match('/^recurring_payment_profile_cancel$/i', $paypal['txn_type'])) {
$paypal['s2member_log'][] = 'Transaction type (`recurring_payment_profile_cancel`), but there is no match to an existing account; so verification of `$_SERVER["HTTP_HOST"]` was not possible.';
$paypal['s2member_log'][] = 'It\'s likely this account was just upgraded/downgraded by s2Member Pro; so the Subscr. ID has probably been updated on-site; nothing to worry about here.';
} else {
if (!empty($paypal['txn_type']) && preg_match('/^recurring_/i', $paypal['txn_type'])) {
// Otherwise, is this a ^recurring_ txn_type?
$paypal['s2member_log'][] = 'Transaction type (`^recurring_?`), but there is no match to an existing account; so verification of `$_SERVER["HTTP_HOST"]` was not possible.';
} else {
// Else, use the default ``$_SERVER['HTTP_HOST']`` error.
$paypal['s2member_log'][] = 'Unable to verify `$_SERVER["HTTP_HOST"]`. Please check the `custom` value in your Button Code. It MUST start with your domain name.';
}
}
}
} else {
$paypal['s2member_log'][] = 'Unable to verify $_POST vars. This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility.';
$paypal['s2member_log'][] = 'Please see this KB article: `http://www.s2member.com/kb/server-scanner/`. We suggest that you run the s2Member Server Scanner.';
$paypal['s2member_log'][] = var_export($_REQUEST, TRUE);
// Recording _POST + _GET vars for analysis and debugging.
}
if ($email_configs_were_on) {
// Back on?
c_ws_plugin__s2member_email_configs::email_config();
}
/*
Add IPN proxy (when available) to the ``$paypal`` array.
*/
if (!empty($_REQUEST['s2member_paypal_proxy'])) {
$paypal['s2member_paypal_proxy'] = esc_html(trim(stripslashes((string) $_REQUEST['s2member_paypal_proxy'])));
}
/*
Add IPN proxy use vars (when available) to the ``$paypal`` array.
*/
if (!empty($_REQUEST['s2member_paypal_proxy_use'])) {
$paypal['s2member_paypal_proxy_use'] = esc_html(trim(stripslashes((string) $_REQUEST['s2member_paypal_proxy_use'])));
}
/*
Add IPN proxy coupon vars (when available) to the ``$paypal`` array.
*/
if (!empty($_REQUEST['s2member_paypal_proxy_coupon'])) {
$paypal['s2member_paypal_proxy_coupon'] = stripslashes_deep((array) $_REQUEST['s2member_paypal_proxy_coupon']);
}
/*
Also add IPN proxy self-verification (when available) to the ``$paypal`` array.
*/
if (!empty($_REQUEST['s2member_paypal_proxy_verification'])) {
$paypal['s2member_paypal_proxy_verification'] = esc_html(trim(stripslashes((string) $_REQUEST['s2member_paypal_proxy_verification'])));
}
/*
If debugging/logging is enabled; we need to append ``$paypal`` 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() ? 'gateway-core-ipn-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'gateway-core-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($paypal, TRUE)) . "\n\n", FILE_APPEND);
}
}
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_during_paypal_notify', get_defined_vars());
unset($__refs, $__v);
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(!empty($paypal['s2member_paypal_proxy_return_url']) ? $paypal['s2member_paypal_proxy_return_url'] : '');
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_after_paypal_notify', get_defined_vars());
unset($__refs, $__v);
}
示例13: configure_user_registration
//.........这里部分代码省略.........
}
if ($email_configs_were_on) {
// Back on?
c_ws_plugin__s2member_email_configs::email_config();
}
unset($sbj, $msg, $var, $val, $recipient, $email_configs_were_on);
// Housekeeping.
}
if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"]) {
if ($url = preg_replace("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) {
if ($url = preg_replace("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($role)), $url)) {
if ($url = preg_replace("/%%level%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($level)), $url)) {
if ($url = preg_replace("/%%ccaps%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($ccaps)), $url)) {
if ($url = preg_replace("/%%auto_eot_time%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($auto_eot_time)), $url)) {
if ($url = preg_replace("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($fname)), $url)) {
if ($url = preg_replace("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($lname)), $url)) {
if ($url = preg_replace("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($name)), $url)) {
if ($url = preg_replace("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($email)), $url)) {
if ($url = preg_replace("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($login)), $url)) {
if ($url = preg_replace("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($pass)), $url)) {
if ($url = preg_replace("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($ip)), $url)) {
if ($url = preg_replace("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($user_id)), $url)) {
foreach ($fields as $var => $val) {
// Custom Fields.
if (!($url = preg_replace("/%%" . preg_quote($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode(maybe_serialize($val))), $url))) {
break;
}
}
if ($url = trim($url)) {
// Preserve remaining Replacements; because the parent routine may perform replacements too.
$GLOBALS["ws_plugin__s2member_registration_return_url"] = $url;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
unset($url, $var, $val);
// Housekeeping.
c_ws_plugin__s2member_list_servers::process_list_servers($role, $level, $login, $pass, $email, $fname, $lname, $ip, $opt_in, true, $user_id);
/*
Suppress errors here in case this routine is fired in unexpected locations; or with odd output buffering techniques.
@todo It may also be impossible to delete cookies when fired inside: `/wp-activate.php`.
*/
if (!headers_sent()) {
@setcookie("s2member_subscr_gateway", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_subscr_gateway", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
@setcookie("s2member_subscr_id", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_subscr_id", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
@setcookie("s2member_custom", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_custom", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
@setcookie("s2member_item_number", "", time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . @setcookie("s2member_item_number", "", time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
}
/* If debugging/logging is enabled; we need to append ``$reg_vars`` to the log file.
Logging now supports Multisite Networking as well. */
$reg_vars = get_defined_vars();
// All defined vars.
// No need to include these in the logs. Unset before log entry.
unset($reg_vars["wpdb"], $reg_vars["current_site"], $reg_vars["current_blog"]);
$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() ? "reg-handler-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "reg-handler.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($reg_vars, true)) . "\n\n", FILE_APPEND);
}
}
}
unset($logt, $logv, $logm, $log4, $_log4, $log2, $logs_dir, $reg_vars);
// Housekeeping.
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_during_configure_user_registration", get_defined_vars());
unset($__refs, $__v);
}
}
}
}
}
}
}
}
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_after_configure_user_registration", get_defined_vars());
unset($__refs, $__v);
return;
}
示例14: paypal_return
//.........这里部分代码省略.........
}
}
}
} else {
/* Else a custom conditional has been applied by filters. */
unset($__refs, $__v);
}
/* Unset defined __refs, __v. */
} else {
$paypal["s2member_log"][] = "Unable to verify `\$_SERVER[\"HTTP_HOST\"]`. Please check the `custom` value in your Button Code. It MUST start with your domain name.";
/**/
$paypal["s2member_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
/**/
echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unable to verify <code>$_SERVER["HTTP_HOST"]</code>.<br />Please contact Support for assistance.<br /><br />If you are the site owner, please check the <code>custom</code> value in your Button Code. It MUST start with your domain name.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
}
} else {
$paypal = $_paypal_cp = c_ws_plugin__s2member_paypal_return_in_proxy_ty_email::cp(get_defined_vars());
}
} else {
if (!empty($_GET["s2member_paypal_proxy"]) && !empty($_GET["s2member_paypal_proxy_use"]) && preg_match("/x-preview/", $_GET["s2member_paypal_proxy_use"]) && ($paypal["subscr_gateway"] = esc_html(trim(stripslashes($_GET["s2member_paypal_proxy"]))))) {
$paypal = $_paypal_cp = c_ws_plugin__s2member_paypal_return_in_proxy_x_preview::cp(get_defined_vars());
} else {
if (empty($_GET["tx"]) && empty($_GET["s2member_paypal_proxy"]) && ($paypal["subscr_gateway"] = "paypal")) {
$paypal = $_paypal_cp = c_ws_plugin__s2member_paypal_return_in_no_tx_data::cp(get_defined_vars());
} else {
$paypal["s2member_log"][] = "Unable to verify \$_POST vars. This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility.";
$paypal["s2member_log"][] = "If you're absolutely SURE that your 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/communicate with your Payment Gateway over an HTTPS connection.";
$paypal["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; and instead, set `allow_url_fopen = yes` in your php.ini file. The `cURL` extension (usually) does NOT support SSL connections on a Windows® server.";
$paypal["s2member_log"][] = "Please see this thread: `http://www.primothemes.com/forums/viewtopic.php?f=36&t=2636` for details regarding the ideal server configuration for s2Member.";
$paypal["s2member_log"][] = var_export($_REQUEST, true);
/* Recording _POST + _GET vars for analysis and debugging. */
/**/
$paypal["s2member_log"][] = "Redirecting Customer to the Home Page, due to an error that occurred.";
/**/
echo c_ws_plugin__s2member_return_templates::return_template("default", _x('<strong>ERROR:</strong> Unable to verify <code>$_POST</code> vars.<br />Please contact Support for assistance.<br /><br />This is most likely related to an invalid configuration of s2Member, or a problem with server compatibility. If you are the site owner, and you\'re absolutely SURE that your configuration is valid, you may want to run some tests on your server, just to be sure <code>$_POST</code> variables are populated, and that your server is able to connect/communicate with your Payment Gateway over an HTTPS connection.<br /><br />s2Member uses the <code>WP_Http</code> class for remote connections; which will try to use <code>cURL</code> first, and then fall back on the <code>FOPEN</code> method when <code>cURL</code> is not available. On a Windows® server, you may have to disable your <code>cURL</code> extension; and instead, set <code>allow_url_fopen = yes</code> in your php.ini file. The <code>cURL</code> extension (usually) does NOT support SSL connections on a Windows® server.<br /><br />Please see <a href="http://www.primothemes.com/forums/viewtopic.php?f=36&t=2636" target="_blank">this thread</a> for details regarding the ideal server configuration for s2Member.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
}
}
}
/*
Add RTN proxy ( when available ) to the ``$paypal`` array.
*/
if (!empty($_GET["s2member_paypal_proxy"])) {
$paypal["s2member_paypal_proxy"] = $_GET["s2member_paypal_proxy"];
}
/*
Add IPN proxy use vars ( when available ) to the ``$paypal`` array.
*/
if (!empty($_GET["s2member_paypal_proxy_use"])) {
$paypal["s2member_paypal_proxy_use"] = $_GET["s2member_paypal_proxy_use"];
}
/*
Also add RTN proxy self-verification ( when available ) to the ``$paypal`` array.
*/
if (!empty($_GET["s2member_paypal_proxy_verification"])) {
$paypal["s2member_paypal_proxy_verification"] = $_GET["s2member_paypal_proxy_verification"];
}
/*
Also add RTN success redirection URL ( when available ) to the ``$paypal`` array.
*/
if (!empty($_GET["s2member_paypal_return_success"])) {
$paypal["s2member_paypal_return_success"] = $_GET["s2member_paypal_return_success"];
}
/*
Also add RTN t and r Attributes ( when available ) to the ``$paypal`` array.
*/
if (!empty($_GET["s2member_paypal_return_tra"])) {
$paypal["s2member_paypal_return_tra"] = $_GET["s2member_paypal_return_tra"];
}
/*
If debugging/logging is enabled; we need to append $paypal to the log file.
Logging now supports Multisite Networking as well.
*/
$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-rtn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-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, $logv . "\n" . $logm . "\n" . $log4 . "\n" . var_export($paypal, true) . "\n\n", FILE_APPEND);
}
}
}
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_during_paypal_return", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
exit;
/* Clean exit. */
}
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_after_paypal_return", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
}
示例15: paypal_api_response
/**
* Calls upon the PayPal® API, and returns the response.
*
* @package s2Member\PayPal
* @since 3.5
*
* @param array $post_vars An array of variables to send through the PayPal® API call.
* @return array An array of variables returned by the PayPal® API.
*
* @todo Optimize this routine with ``empty()`` and ``isset()``.
* @todo Possibly integrate this API: {@link http://msdn.microsoft.com/en-us/library/ff512417.aspx}.
*/
public static function paypal_api_response($post_vars = FALSE)
{
global $current_site, $current_blog;
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_before_paypal_api_response", get_defined_vars());
unset($__refs, $__v);
/**/
$url = "https://" . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "api-3t.sandbox.paypal.com" : "api-3t.paypal.com") . "/nvp";
/**/
$post_vars = apply_filters("ws_plugin__s2member_paypal_api_post_vars", $post_vars, get_defined_vars());
$post_vars = is_array($post_vars) ? $post_vars : array();
/**/
$post_vars["VERSION"] = "71.0";
$post_vars["USER"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"];
$post_vars["PWD"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"];
$post_vars["SIGNATURE"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"];
/**/
$input_time = date("D M j, Y g:i:s a T");
/**/
$nvp = trim(c_ws_plugin__s2member_utils_urls::remote($url, $post_vars, array("timeout" => 20)));
/**/
$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["ACK"] || !preg_match("/^(Success|SuccessWithWarning)\$/i", $response["ACK"])) {
if (strlen($response["L_ERRORCODE0"]) || $response["L_SHORTMESSAGE0"] || $response["L_LONGMESSAGE0"]) {
/* translators: Exclude `%2$s` and `%3$s`. These are English details returned by PayPal®. Replace `%2$s` and `%3$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_api_response`. */
$response["__error"] = sprintf(_x('Error #%1$s. %2$s. %3$s.', "s2member-front", "s2member"), $response["L_ERRORCODE0"], rtrim($response["L_SHORTMESSAGE0"], "."), rtrim($response["L_LONGMESSAGE0"], "."));
} else {
/* Else, generate an error messsage - so something is reported back to the Customer. */
$response["__error"] = _x("Error. Please contact Support for assistance.", "s2member-front", "s2member");
}
}
/**/
$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-api-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-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" . 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, $logv . "\n" . $logm . "\n" . $log4 . "\n" . $log . "\n\n", FILE_APPEND);
}
}
}
}
}
/**/
return apply_filters("ws_plugin__s2member_paypal_api_response", c_ws_plugin__s2member_paypal_utilities::_paypal_api_response_filters($response), get_defined_vars());
}