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


PHP c_ws_plugin__s2member_utilities::mem_details方法代码示例

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


在下文中一共展示了c_ws_plugin__s2member_utilities::mem_details方法的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.
     }
 }
开发者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: log_entry

 /**
  * Logs Stripe API communication.
  *
  * @param string  $function Name of the caller.
  *
  * @param integer $input_time Input time.
  * @param mixed   $input_vars Input data/vars.
  *
  * @param integer $output_time Output time.
  * @param mixed   $output_vars Output data/vars.
  */
 public static function log_entry($function, $input_time, $input_vars, $output_time, $output_vars)
 {
     global $current_site, $current_blog;
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
         return;
     }
     // Nothing to do in this case.
     $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() ? 'stripe-api-4-' . trim(preg_replace('/[^a-z0-9]/i', '-', !empty($_log4) ? $_log4 : ''), '-') . '.log' : 'stripe-api.log';
     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 = '-------- Function/Caller: ( ' . $function . ' ) --------' . "\n") {
                 if ($log .= '-------- Input vars: ( ' . date(DATE_RFC822, $input_time) . ' ) --------' . "\n" . print_r($input_vars, TRUE) . "\n") {
                     if ($log .= '-------- Output string/vars: ( ' . date(DATE_RFC822, $output_time) . ' ) --------' . "\n" . print_r($output_vars, 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);
                     }
                 }
             }
         }
     }
 }
开发者ID:SollyNZ,项目名称:damn-plugins,代码行数:36,代码来源:stripe-utilities.inc.php

示例6: authnet_notify

 /**
  * Handles Authorize.Net® IPN URL processing.
  *
  * @package s2Member\AuthNet
  * @since 1.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after handling IPN processing.
  */
 public static function authnet_notify()
 {
     global $current_site, $current_blog;
     /* For Multisite support. */
     /**/
     if (!empty($_GET["s2member_pro_authnet_notify"]) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_authnet_api_login_id"]) {
         @ignore_user_abort(true);
         /* Continue processing even if/when connection is broken by the sender. */
         /**/
         if (is_array($authnet = c_ws_plugin__s2member_pro_authnet_utilities::authnet_postvars()) && ($_authnet = $authnet)) {
             $authnet["s2member_log"][] = "IPN received on: " . date("D M j, Y g:i:s a T");
             $authnet["s2member_log"][] = "s2Member POST vars verified with Authorize.Net®.";
             /**/
             if ($authnet["x_subscription_id"] && $authnet["x_subscription_paynum"] && $authnet["x_response_code"] === "1") {
                 if (($_authnet = c_ws_plugin__s2member_pro_authnet_utilities::authnet_parse_arb_desc($authnet)) && ($authnet = $_authnet)) {
                     $authnet["s2member_log"][] = "Authorize.Net® transaction identified as ( `ARB / PAYMENT #" . $authnet["x_subscription_paynum"] . "` ).";
                     $authnet["s2member_log"][] = "IPN reformulated. Piping through s2Member's core/standard PayPal® processor as `txn_type` ( `subscr_payment` ).";
                     $authnet["s2member_log"][] = "Please check PayPal® IPN logs for further processing details.";
                     /**/
                     $processing = $processed = true;
                     $ipn = array();
                     /* Reset. */
                     /**/
                     $ipn["txn_type"] = "subscr_payment";
                     $ipn["subscr_id"] = $authnet["x_subscription_id"];
                     $ipn["txn_id"] = $authnet["x_trans_id"];
                     /**/
                     $ipn["custom"] = $authnet["s2_custom"];
                     /**/
                     $ipn["mc_gross"] = number_format($authnet["x_amount"], 2, ".", "");
                     $ipn["mc_currency"] = strtoupper("USD");
                     /* Auth.Net® uses USD. */
                     $ipn["tax"] = number_format($authnet["x_tax"], 2, ".", "");
                     /**/
                     $ipn["payer_email"] = $authnet["x_email"];
                     $ipn["first_name"] = $authnet["x_first_name"];
                     $ipn["last_name"] = $authnet["x_last_name"];
                     /**/
                     $ipn["option_name1"] = "Referencing Customer ID";
                     $ipn["option_selection1"] = $authnet["x_subscription_id"];
                     /**/
                     $ipn["option_name2"] = "Customer IP Address";
                     $ipn["option_selection2"] = null;
                     /**/
                     $ipn["item_number"] = $authnet["s2_invoice"];
                     $ipn["item_name"] = $authnet["x_description"];
                     /**/
                     $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 {
                     $authnet["s2member_log"][] = "Authorize.Net® transaction identified as ( `ARB / PAYMENT #" . $authnet["x_subscription_paynum"] . "` ).";
                     $authnet["s2member_log"][] = "Ignoring this IPN. The transaction does NOT contain a valid reference value/desc.";
                 }
             } else {
                 if ($authnet["x_subscription_id"] && $authnet["x_subscription_paynum"] && preg_match("/^(2|3)\$/", $authnet["x_response_code"])) {
                     if (($_authnet = c_ws_plugin__s2member_pro_authnet_utilities::authnet_parse_arb_desc($authnet)) && ($authnet = $_authnet)) {
                         $authnet["s2member_log"][] = "Authorize.Net® transaction identified as ( `ARB / FAILED PAYMENT` ).";
                         $authnet["s2member_log"][] = "s2Member does NOT respond to individual failed payment notifications.";
                         $authnet["s2member_log"][] = "When multiple consecutive payments fail, s2Member is notified via ARB services.";
                         $authnet["s2member_log"][] = "This does not require any action ( at the moment ) on the part of s2Member.";
                     } else {
                         $authnet["s2member_log"][] = "Authorize.Net® transaction identified as ( `ARB / FAILED PAYMENT` ).";
                         $authnet["s2member_log"][] = "Ignoring this IPN. The transaction does NOT contain a valid reference value/desc.";
                     }
                 } else {
                     if (!$processed) {
                         /* If nothing was processed, here we add a message to the logs indicating the IPN was ignored. */
                         $authnet["s2member_log"][] = "Ignoring this IPN. The transaction does NOT require any action on the part of s2Member.";
                     }
                 }
             }
         } else {
             $authnet["s2member_log"][] = "Unable to verify POST vars. This is most likely related to an invalid Authorize.Net® configuration. Please check: s2Member -> Authorize.Net® Options.";
             $authnet["s2member_log"][] = "If you're absolutely SURE that your Authorize.Net® 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 Authorize.Net® over an HTTPS connection.";
             $authnet["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.";
             $authnet["s2member_log"][] = var_export($_REQUEST, true);
             /* Recording _POST + _GET vars for analysis and debugging. */
         }
         /*
         If debugging/logging is enabled; we need to append $authnet 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() ? "authnet-ipn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "authnet-ipn.log";
         /**/
//.........这里部分代码省略.........
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:101,代码来源:authnet-notify-in.inc.php

示例7: 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

示例8: 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. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:101,代码来源:authnet-arb.inc.php

示例9: 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;
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:101,代码来源:registrations.inc.php

示例10: paypal_notify


//.........这里部分代码省略.........
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     // Else a custom conditional has been applied by Filters.
                     unset($__refs, $__v);
                 }
             } 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"] . "\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() ? "gateway-core-ipn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_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);
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:101,代码来源:paypal-notify-in.inc.php

示例11: 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

示例12: 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.
     }
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:86,代码来源:alipay-return-in.inc.php

示例13: paypal_notify


//.........这里部分代码省略.........
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     /* Else a custom conditional has been applied by Filters. */
                     unset($__refs, $__v);
                 }
                 /* Unset defined __refs, __v. */
             } 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"][] = "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. */
         }
         /**/
         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($_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 IPN 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"];
         }
         /*
         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-ipn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "paypal-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($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_notify", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __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. */
         eval('while (@ob_end_clean ());');
         /* End/clean all output buffers that may or may not exist. */
         /**/
         exit(!empty($paypal["s2member_paypal_proxy_return_url"]) ? $paypal["s2member_paypal_proxy_return_url"] : "");
     }
     /**/
     eval('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);
     /* Unset defined __refs, __v. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:101,代码来源:paypal-notify-in.inc.php

示例14: authnet_arb_response


//.........这里部分代码省略.........
             $xml .= '</customer>';
             /**/
             $xml .= '<billTo>';
             $xml .= '<firstName>' . esc_html($post_vars["x_first_name"]) . '</firstName>';
             $xml .= '<lastName>' . esc_html($post_vars["x_last_name"]) . '</lastName>';
             $xml .= '<address>' . esc_html($post_vars["x_address"]) . '</address>';
             $xml .= '<city>' . esc_html($post_vars["x_city"]) . '</city>';
             $xml .= '<state>' . esc_html($post_vars["x_state"]) . '</state>';
             $xml .= '<zip>' . esc_html($post_vars["x_zip"]) . '</zip>';
             $xml .= '<country>' . esc_html($post_vars["x_country"]) . '</country>';
             $xml .= '</billTo>';
             /**/
             $xml .= '</subscription>';
             /**/
             $xml .= '</ARBUpdateSubscriptionRequest>';
         } else {
             if (!empty($post_vars["x_method"]) && $post_vars["x_method"] === "status") {
                 $xml = '<?xml version="1.0" encoding="utf-8"?>';
                 /**/
                 $xml .= '<ARBGetSubscriptionStatusRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">';
                 /**/
                 $xml .= '<merchantAuthentication>';
                 $xml .= '<name>' . esc_html($post_vars["x_login"]) . '</name>';
                 $xml .= '<transactionKey>' . esc_html($post_vars["x_tran_key"]) . '</transactionKey>';
                 $xml .= '</merchantAuthentication>';
                 /**/
                 $xml .= '<subscriptionId>' . esc_html($post_vars["x_subscription_id"]) . '</subscriptionId>';
                 /**/
                 $xml .= '</ARBGetSubscriptionStatusRequest>';
             } else {
                 if (!empty($post_vars["x_method"]) && $post_vars["x_method"] === "cancel") {
                     $xml = '<?xml version="1.0" encoding="utf-8"?>';
                     /**/
                     $xml .= '<ARBCancelSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">';
                     /**/
                     $xml .= '<merchantAuthentication>';
                     $xml .= '<name>' . esc_html($post_vars["x_login"]) . '</name>';
                     $xml .= '<transactionKey>' . esc_html($post_vars["x_tran_key"]) . '</transactionKey>';
                     $xml .= '</merchantAuthentication>';
                     /**/
                     $xml .= '<subscriptionId>' . esc_html($post_vars["x_subscription_id"]) . '</subscriptionId>';
                     /**/
                     $xml .= '</ARBCancelSubscriptionRequest>';
                 }
             }
         }
     }
     /**/
     $req["headers"]["Accept"] = "application/xml; charset=UTF-8";
     $req["headers"]["Content-Type"] = "application/xml; charset=UTF-8";
     /**/
     $input_time = date("D M j, Y g:i:s a T");
     /* Record input time for logging. */
     /**/
     $xml = trim(c_ws_plugin__s2member_utils_urls::remote($url, $xml, array_merge($req, array("timeout" => 20))));
     /**/
     $output_time = date("D M j, Y g:i:s a T");
     /* Now record after output time. */
     /**/
     $response = c_ws_plugin__s2member_pro_authnet_utilities::_authnet_parse_arb_response($xml);
     /**/
     if (empty($response["response_code"]) || $response["response_code"] !== "I00001") {
         if (strlen($response["response_reason_code"]) || $response["response_reason_text"]) {
             /* translators: Exclude `%2$s`. This is an English error returned by Authorize.Net®. Please 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_pro_authnet_arb_response`. */
             $response["__error"] = sprintf(_x('Error #%1$s. %2$s.', "s2member-front", "s2member"), $response["response_reason_code"], rtrim($response["response_reason_text"], "."));
         } 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");
         }
     }
     /*
     If debugging is enabled; we need to maintain a comprehensive 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() ? "authnet-api-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "authnet-api.log";
     /**/
     if (strlen($post_vars["x_card_num"]) > 4) {
         /* Only log last 4 digits for security. */
         $post_vars["x_card_num"] = str_repeat("*", strlen($post_vars["x_card_num"]) - 4) . substr($post_vars["x_card_num"], -4);
     }
     /* Then display last 4 digits. */
     /**/
     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" . $xml . "\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_pro_authnet_arb_response", c_ws_plugin__s2member_pro_authnet_utilities::_authnet_arb_response_filters($response), get_defined_vars());
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:101,代码来源:authnet-utilities.inc.php

示例15: google_notify


//.........这里部分代码省略.........
                     $ipn = array();
                     // Reset.
                     $ipn["txn_type"] = "subscr_signup";
                     $ipn["subscr_id"] = $google["response"]["orderId"];
                     $ipn["txn_id"] = $google["response"]["orderId"];
                     $ipn["recurring"] = $s2vars["rr"];
                     $ipn["custom"] = $s2vars["cs"];
                     $ipn["period1"] = $s2vars["p1"];
                     $ipn["period3"] = $s2vars["p3"];
                     $ipn["mc_amount1"] = $ipn["mc_gross"] = number_format($google["request"]["initialPayment"]["price"], 2, ".", "");
                     $ipn["mc_currency"] = strtoupper($google["request"]["initialPayment"]["currencyCode"]);
                     $ipn["tax"] = number_format((double) @$google["request"]["initialPayment"]["tax"], 2, ".", "");
                     $ipn["mc_amount3"] = number_format($google["request"]["recurrence"]["price"], 2, ".", "");
                     $ipn["payer_email"] = $s2vars["em"];
                     $ipn["first_name"] = $s2vars["fn"];
                     $ipn["last_name"] = $s2vars["ln"];
                     $ipn["option_name1"] = $s2vars["rf"] ? "Referencing Customer ID" : "Originating Domain";
                     $ipn["option_selection1"] = $s2vars["rf"] ? $s2vars["rf"] : $_SERVER["HTTP_HOST"];
                     $ipn["option_name2"] = "Customer IP Address";
                     // IP Address.
                     $ipn["option_selection2"] = $s2vars["ip"];
                     $ipn["item_number"] = $s2vars["in"];
                     $ipn["item_name"] = $google["request"]["description"];
                     $ipn["s2member_paypal_proxy"] = "google";
                     $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 (!empty($google["typ"]) && preg_match('/^google\\/payments\\/inapp\\/subscription\\/v[0-9]+\\/canceled$/i', $google["typ"]) && !empty($google["response"]["statusCode"]) && preg_match("/^SUBSCRIPTION_CANCELED\$/i", $google["response"]["statusCode"]) && !empty($google["response"]["orderId"]) && ($ipn_signup_vars = c_ws_plugin__s2member_utils_users::get_user_ipn_signup_vars(false, $google["response"]["orderId"]))) {
                         $google["s2member_log"][] = "Google transaction identified as ( `SUBSCRIPTION_CANCELED` ).";
                         $google["s2member_log"][] = "IPN reformulated. Piping through s2Member's core/standard PayPal processor as `txn_type` ( `subscr_cancel` ).";
                         $google["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"] = $google["response"]["orderId"];
                         $ipn["custom"] = $ipn_signup_vars["custom"];
                         $ipn["period1"] = $ipn_signup_vars["period1"];
                         $ipn["period3"] = $ipn_signup_vars["period3"];
                         $ipn["payer_email"] = $ipn_signup_vars["payer_email"];
                         $ipn["first_name"] = $ipn_signup_vars["first_name"];
                         $ipn["last_name"] = $ipn_signup_vars["last_name"];
                         $ipn["option_name1"] = $ipn_signup_vars["option_name1"];
                         $ipn["option_selection1"] = $ipn_signup_vars["option_selection1"];
                         $ipn["option_name2"] = $ipn_signup_vars["option_name2"];
                         $ipn["option_selection2"] = $ipn_signup_vars["option_selection2"];
                         $ipn["item_number"] = $ipn_signup_vars["item_number"];
                         $ipn["item_name"] = $ipn_signup_vars["item_name"];
                         $ipn["s2member_paypal_proxy"] = "google";
                         $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 (!$processed) {
                             // If nothing was processed, here we add a message to the logs indicating the IPN was ignored.
                             $google["s2member_log"][] = "Ignoring this IPN request. The transaction does NOT require any action on the part of s2Member.";
                         }
                     }
                 }
             }
         } else {
             $google["s2member_log"][] = "Unable to verify POST vars. This is most likely related to an invalid Google configuration. Please check: s2Member ⥱ Google Options.";
             $google["s2member_log"][] = "If you're absolutely SURE that your Google 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 Google over an HTTPS connection.";
             $google["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.";
             $google["s2member_log"][] = var_export($_REQUEST, true);
             // Recording _POST + _GET vars for analysis and debugging.
         }
         /*
         We need to log this final event before it occurs.
         */
         $google["s2member_log"][] = "Sending Google an acknowlegment w/ order ID.";
         /*
         If debugging/logging is enabled; we need to append $google 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() ? "google-ipn-4-" . trim(preg_replace("/[^a-z0-9]/i", "-", $_log4), "-") . ".log" : "google-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($google, true)) . "\n\n", FILE_APPEND);
                 }
             }
         }
         status_header(200);
         // Send a 200 OK status header.
         header("Content-Type: text/plain");
         // Google expects text/plain here.
         while (@ob_end_clean()) {
         }
         // Clean any existing output buffers.
         exit(!empty($google["response"]["orderId"]) ? $google["response"]["orderId"] : "");
     }
 }
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:101,代码来源:google-notify-in.inc.php


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