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


PHP c_ws_plugin__s2member_paypal_utilities::paypal_postvars方法代码示例

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


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

示例1: paypal_return

 /**
  * Handles PayPal Return URLs.
  *
  * @package s2Member\PayPal
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection.
  */
 public static function paypal_return()
 {
     global $current_site, $current_blog;
     do_action("ws_plugin__s2member_before_paypal_return", get_defined_vars());
     if (!empty($_GET["s2member_paypal_return"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !empty($_GET["s2member_paypal_proxy"]))) {
         $custom_success_redirection = !empty($_GET["s2member_paypal_return_success"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_return_success"]))) : false;
         $custom_success_redirection = $custom_success_redirection ? str_ireplace(array("&", "&"), "&", $custom_success_redirection) : $custom_success_redirection;
         if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars()) && ($_paypal = $paypal) && ($_paypal_s = serialize($_paypal))) {
             $paypal["s2member_log"][] = "Return-Data received on: " . date("D M j, Y g:i:s a T");
             $paypal["s2member_log"][] = "s2Member POST vars verified " . (!empty($paypal["proxy_verified"]) ? "with a Proxy Key" : "through a POST back to PayPal.");
             $paypal["subscr_gateway"] = !empty($_GET["s2member_paypal_proxy"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_proxy"]))) : "paypal";
             if (empty($_GET["s2member_paypal_proxy"]) || empty($_GET["s2member_paypal_proxy_use"]) || !preg_match("/ty-email/", $_GET["s2member_paypal_proxy_use"])) {
                 $payment_status_issues = "/^(failed|denied|expired|refunded|partially_refunded|reversed|reversal|canceled_reversal|voided)\$/i";
                 if (!empty($paypal["custom"]) && preg_match("/^" . preg_quote(preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"])) {
                     $paypal["s2member_log"][] = "s2Member originating domain ( `\$_SERVER[\"HTTP_HOST\"]` ) validated.";
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     if (!apply_filters("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars())) {
                         unset($__refs, $__v);
                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_web_accept_sp::cp(get_defined_vars())) {
                             $paypal = $_paypal_cp;
                         } else {
                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_wa_ccaps_wo_level::cp(get_defined_vars())) {
                                 $paypal = $_paypal_cp;
                             } else {
                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_subscr_or_wa_w_level::cp(get_defined_vars())) {
                                     $paypal = $_paypal_cp;
                                 } else {
                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_subscr_modify_w_level::cp(get_defined_vars())) {
                                         $paypal = $_paypal_cp;
                                     } else {
                                         $paypal["s2member_log"][] = "Unexpected `txn_type/status`. The `txn_type/status` did not match a required action.";
                                         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after displaying an error message).";
                                         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>ERROR:</strong> Unexpected <code>txn_type/status</code>.<br />The <code>txn_type/status</code> did not meet requirements.<br />Please contact Support for assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                                     }
                                 }
                             }
                         }
                     } else {
                         // Else a custom conditional has been applied by filters.
                         unset($__refs, $__v);
                     }
                 } else {
                     if ($paypal["custom"] && ($paypal["custom"] === "www." . $_SERVER["HTTP_HOST"] || "www." . $paypal["custom"] === $_SERVER["HTTP_HOST"])) {
                         c_ws_plugin__s2member_admin_notices::enqueue_admin_notice("<strong>s2Member:</strong> Post-processing failed on at least one transaction. It appears that you have a PayPal Button configured with a <code>custom=\"\"</code> Shortcode Attribute that does NOT match up with your installation domain name. If your site uses the <code>www.</code> prefix, please include that. If it does not, please exclude the <code>www.</code> prefix. You should have <code>custom=\"" . preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]) . "\"</code>", "*:*", true);
                     }
                     $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 (after displaying an error message).";
                     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 {
                 // In this case ... a Proxy has explicitly requested `ty-email` processing.
                 $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 {
                     if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_identity_token"]) {
                         c_ws_plugin__s2member_admin_notices::enqueue_admin_notice("<strong>s2Member:</strong> You have no PayPal PDT Identity Token configured. PayPal Auto-Return handling failed. Please update your PayPal PDT Identity Key. See: <code>s2Member -› PayPal Options -› PayPal PDT/Auto-Return Integration</code>. Thank you!", "*:*", true);
                     }
                     $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 make sure that you configure a PayPal PDT Identity Token for your installation of s2Member. See: `s2Member -› PayPal Options -› PayPal PDT/Auto-Return Integration`.";
                     $paypal["s2member_log"][] = "See also, 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);
                     $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after displaying an error message).";
                     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.s2member.com/forums/topic/ideal-server-configuration-for-s2member/" 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"])) {
//.........这里部分代码省略.........
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:101,代码来源:paypal-return-in.inc.php

示例2: paypal_notify

 /**
  * Handles PayPal IPN processing.
  *
  * These same routines also handle s2Member Pro/PayPal Pro operations;
  * giving you the ability *(as needed)* to Hook into these routines using
  * WordPress Hooks/Filters; as seen in the source code below.
  *
  * Please do NOT modify the source code directly.
  * Instead, use WordPress Hooks/Filters.
  *
  * For example, if you'd like to add your own custom conditionals, use:
  * ``add_filter ('ws_plugin__s2member_during_paypal_notify_conditionals', 'your_function');``
  *
  * @package s2Member\PayPal
  * @since 3.5
  *
  * @attaches-to ``add_action('init');``
  */
 public static function paypal_notify()
 {
     global $current_site, $current_blog;
     do_action('ws_plugin__s2member_before_paypal_notify', get_defined_vars());
     if (!empty($_GET['s2member_paypal_notify']) && ($GLOBALS['WS_PLUGIN__']['s2member']['o']['paypal_business'] || !empty($_REQUEST['s2member_paypal_proxy']))) {
         @ignore_user_abort(TRUE);
         // Important. Continue processing even if/when the connection is broken by the sending party.
         include_once ABSPATH . 'wp-admin/includes/admin.php';
         // Get administrative functions. Needed for `wp_delete_user()`.
         $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
         // Filters on?
         c_ws_plugin__s2member_email_configs::email_config_release();
         // Release s2Member Filters.
         $paypal = array();
         // Initialize PayPal array; we also reference this with a variable for a possible proxy handler.
         if (!empty($_REQUEST['s2member_paypal_proxy']) && in_array($_REQUEST['s2member_paypal_proxy'], array('alipay', 'stripe', 'authnet', 'clickbank', 'ccbill', 'google'), TRUE)) {
             ${esc_html(trim(stripslashes($_REQUEST['s2member_paypal_proxy'])))} =& $paypal;
         }
         // Internal alias by reference.
         if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars()) && ($_paypal = $paypal) && ($_paypal_s = serialize($_paypal))) {
             $paypal['s2member_log'][] = 'IPN received on: ' . date('D M j, Y g:i:s a T');
             $paypal['s2member_log'][] = 's2Member POST vars verified ' . (!empty($paypal['proxy_verified']) ? 'with a Proxy Key' : 'through a POST back to PayPal.');
             $payment_status_issues = '/^(failed|denied|expired|refunded|partially_refunded|reversed|reversal|canceled_reversal|voided)$/i';
             $paypal['subscr_gateway'] = !empty($_REQUEST['s2member_paypal_proxy']) ? esc_html(trim(stripslashes($_REQUEST['s2member_paypal_proxy']))) : 'paypal';
             $coupon = !empty($_REQUEST['s2member_paypal_proxy_coupon']) && is_array($_REQUEST['s2member_paypal_proxy_coupon']) ? stripslashes_deep($_REQUEST['s2member_paypal_proxy_coupon']) : array();
             $coupon = isset($coupon['full_coupon_code'], $coupon['coupon_code'], $coupon['affiliate_id']) && is_string($coupon['full_coupon_code']) && is_string($coupon['coupon_code']) && is_string($coupon['affiliate_id']) ? $coupon : array('full_coupon_code' => '', 'coupon_code' => '', 'affiliate_id' => '');
             if (!empty($paypal['txn_type']) && $paypal['txn_type'] === 'merch_pmt') {
                 // This is mostly irrelevant, but it helps to keep the logs cleaner.
                 sleep(15);
             }
             // Wait for Pro-Form procesing to complete.
             if (empty($paypal['custom']) && !empty($paypal['recurring_payment_id'])) {
                 // Recurring Profile ID.
                 $paypal['custom'] = c_ws_plugin__s2member_utils_users::get_user_custom_with($paypal['recurring_payment_id']);
             } else {
                 if (empty($paypal['custom']) && !empty($paypal['mp_id'])) {
                     // Billing Agreement ID.
                     $paypal['custom'] = c_ws_plugin__s2member_utils_users::get_user_custom_with($paypal['mp_id']);
                 }
             }
             if (!empty($paypal['custom']) && preg_match('/^' . preg_quote(preg_replace('/\\:([0-9]+)$/', '', $_SERVER['HTTP_HOST']), '/') . '/i', $paypal['custom'])) {
                 $paypal['s2member_log'][] = 's2Member originating domain (`$_SERVER["HTTP_HOST"]`) validated.';
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 if (!apply_filters('ws_plugin__s2member_during_paypal_notify_conditionals', FALSE, get_defined_vars())) {
                     unset($__refs, $__v);
                     // From the filter above.
                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_virtual_terminal::cp(get_defined_vars())) {
                         $paypal = $_paypal_cp;
                     } else {
                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_express_checkout::cp(get_defined_vars())) {
                             $paypal = $_paypal_cp;
                         } else {
                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_cart::cp(get_defined_vars())) {
                                 $paypal = $_paypal_cp;
                             } else {
                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_send_money::cp(get_defined_vars())) {
                                     $paypal = $_paypal_cp;
                                 } else {
                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_web_accept_sp::cp(get_defined_vars())) {
                                         $paypal = $_paypal_cp;
                                     } else {
                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_wa_ccaps_wo_level::cp(get_defined_vars())) {
                                             $paypal = $_paypal_cp;
                                         } else {
                                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_wa_w_level::cp(get_defined_vars())) {
                                                 $paypal = $_paypal_cp;
                                             } else {
                                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_rec_profile_creation_w_level::cp(get_defined_vars())) {
                                                     $paypal = $_paypal_cp;
                                                 } else {
                                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_modify_w_level::cp(get_defined_vars())) {
                                                         $paypal = $_paypal_cp;
                                                     } else {
                                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_payment_w_level::cp(get_defined_vars())) {
                                                             $paypal = $_paypal_cp;
                                                         } else {
                                                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_payment_failed_w_level::cp(get_defined_vars())) {
                                                                 $paypal = $_paypal_cp;
                                                             } else {
                                                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_cancellation_w_level::cp(get_defined_vars())) {
//.........这里部分代码省略.........
开发者ID:adnandot,项目名称:intenseburn,代码行数:101,代码来源:paypal-notify-in.inc.php

示例3: paypal_notify

 /**
  * Handles PayPal® IPN processing.
  *
  * These same routines also handle s2Member Pro/PayPal® Pro operations;
  * giving you the ability *( as needed )* to Hook into these routines using
  * WordPress® Hooks/Filters; as seen in the source code below.
  *
  * Please do NOT modify the source code directly.
  * Instead, use WordPress® Hooks/Filters.
  *
  * For example, if you'd like to add your own custom conditionals, use:
  * ``add_filter ("ws_plugin__s2member_during_paypal_notify_conditionals", "your_function");``
  *
  * @package s2Member\PayPal
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after handling IPN procesing.
  */
 public static function paypal_notify()
 {
     global $current_site, $current_blog;
     /* For Multisite support. */
     /**/
     do_action("ws_plugin__s2member_before_paypal_notify", get_defined_vars());
     /**/
     if (!empty($_GET["s2member_paypal_notify"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !empty($_GET["s2member_paypal_proxy"]))) {
         @ignore_user_abort(true);
         /* Important. Continue processing even if/when the connection is broken by the sending party. */
         /**/
         include_once ABSPATH . "wp-admin/includes/admin.php";
         /* Get administrative functions. Needed for `wp_delete_user()`. */
         /**/
         $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
         /* Filters on? */
         c_ws_plugin__s2member_email_configs::email_config_release();
         /* Release s2Member Filters. */
         /**/
         if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars()) && ($_paypal = $paypal) && ($_paypal_s = serialize($_paypal))) {
             $paypal["s2member_log"][] = "IPN received on: " . date("D M j, Y g:i:s a T");
             $paypal["s2member_log"][] = "s2Member POST vars verified " . (!empty($paypal["proxy_verified"]) ? "with a Proxy Key" : "through a POST back to PayPal®.");
             /**/
             $payment_status_issues = "/^(failed|denied|expired|refunded|partially_refunded|reversed|reversal|canceled_reversal|voided)\$/i";
             /**/
             $paypal["subscr_gateway"] = !empty($_GET["s2member_paypal_proxy"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_proxy"]))) : "paypal";
             /**/
             if (empty($paypal["custom"]) && !empty($paypal["recurring_payment_id"])) {
                 /* Lookup on Recurring Profiles? */
                 $paypal["custom"] = c_ws_plugin__s2member_utils_users::get_user_custom_with($paypal["recurring_payment_id"]);
             }
             /**/
             if (!empty($paypal["custom"]) && preg_match("/^" . preg_quote(preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"])) {
                 $paypal["s2member_log"][] = "s2Member originating domain ( `\$_SERVER[\"HTTP_HOST\"]` ) validated.";
                 /**/
                 eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                 if (!apply_filters("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars())) {
                     unset($__refs, $__v);
                     /* Unset defined __refs, __v. */
                     /**/
                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_virtual_terminal::cp(get_defined_vars())) {
                         $paypal = $_paypal_cp;
                     } else {
                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_express_checkout::cp(get_defined_vars())) {
                             $paypal = $_paypal_cp;
                         } else {
                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_cart::cp(get_defined_vars())) {
                                 $paypal = $_paypal_cp;
                             } else {
                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_send_money::cp(get_defined_vars())) {
                                     $paypal = $_paypal_cp;
                                 } else {
                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_web_accept_sp::cp(get_defined_vars())) {
                                         $paypal = $_paypal_cp;
                                     } else {
                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_wa_ccaps_wo_level::cp(get_defined_vars())) {
                                             $paypal = $_paypal_cp;
                                         } else {
                                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_wa_w_level::cp(get_defined_vars())) {
                                                 $paypal = $_paypal_cp;
                                             } else {
                                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_rec_profile_creation_w_level::cp(get_defined_vars())) {
                                                     $paypal = $_paypal_cp;
                                                 } else {
                                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_modify_w_level::cp(get_defined_vars())) {
                                                         $paypal = $_paypal_cp;
                                                     } else {
                                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_payment_w_level::cp(get_defined_vars())) {
                                                             $paypal = $_paypal_cp;
                                                         } else {
                                                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_payment_failed_w_level::cp(get_defined_vars())) {
                                                                 $paypal = $_paypal_cp;
                                                             } else {
                                                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_cancellation_w_level::cp(get_defined_vars())) {
                                                                     $paypal = $_paypal_cp;
                                                                 } else {
                                                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_eots_w_level::cp(get_defined_vars())) {
                                                                         $paypal = $_paypal_cp;
                                                                     } else {
                                                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_sp_refund_reversal::cp(get_defined_vars())) {
//.........这里部分代码省略.........
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:101,代码来源:paypal-notify-in.inc.php

示例4: paypal_return

 /**
  * Handles PayPal® Return URLs.
  *
  * @package s2Member\PayPal
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection.
  */
 public static function paypal_return()
 {
     global $current_site, $current_blog;
     /* For Multisite support. */
     /**/
     do_action("ws_plugin__s2member_before_paypal_return", get_defined_vars());
     /**/
     if (!empty($_GET["s2member_paypal_return"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !empty($_GET["s2member_paypal_proxy"]))) {
         $custom_success_redirection = !empty($_GET["s2member_paypal_return_success"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_return_success"]))) : false;
         $custom_success_redirection = $custom_success_redirection ? str_ireplace(array("&#038;", "&amp;"), "&", $custom_success_redirection) : $custom_success_redirection;
         /**/
         if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars()) && ($_paypal = $paypal) && ($_paypal_s = serialize($_paypal))) {
             $paypal["s2member_log"][] = "Return-Data received on: " . date("D M j, Y g:i:s a T");
             $paypal["s2member_log"][] = "s2Member POST vars verified " . (!empty($paypal["proxy_verified"]) ? "with a Proxy Key" : "through a POST back to PayPal®.");
             /**/
             $paypal["subscr_gateway"] = !empty($_GET["s2member_paypal_proxy"]) ? esc_html(trim(stripslashes($_GET["s2member_paypal_proxy"]))) : "paypal";
             /**/
             if (empty($_GET["s2member_paypal_proxy"]) || empty($_GET["s2member_paypal_proxy_use"]) || !preg_match("/ty-email/", $_GET["s2member_paypal_proxy_use"])) {
                 $payment_status_issues = "/^(failed|denied|expired|refunded|partially_refunded|reversed|reversal|canceled_reversal|voided)\$/i";
                 /**/
                 if (!empty($paypal["custom"]) && preg_match("/^" . preg_quote(preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"])) {
                     $paypal["s2member_log"][] = "s2Member originating domain ( `\$_SERVER[\"HTTP_HOST\"]` ) validated.";
                     /**/
                     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                     if (!apply_filters("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars())) {
                         unset($__refs, $__v);
                         /* Unset defined __refs, __v. */
                         /**/
                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_web_accept_sp::cp(get_defined_vars())) {
                             $paypal = $_paypal_cp;
                         } else {
                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_wa_ccaps_wo_level::cp(get_defined_vars())) {
                                 $paypal = $_paypal_cp;
                             } else {
                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_subscr_or_wa_w_level::cp(get_defined_vars())) {
                                     $paypal = $_paypal_cp;
                                 } else {
                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_return_in_subscr_modify_w_level::cp(get_defined_vars())) {
                                         $paypal = $_paypal_cp;
                                     } else {
                                         $paypal["s2member_log"][] = "Unexpected `txn_type/status`. The `txn_type/status` did not match a required action.";
                                         /**/
                                         $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> Unexpected <code>txn_type/status</code>.<br />The <code>txn_type/status</code> did not meet requirements.<br />Please contact Support for assistance.', "s2member-front", "s2member"), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
                                     }
                                 }
                             }
                         }
                     } 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"];
         }
//.........这里部分代码省略.........
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:101,代码来源:paypal-return-in.inc.php

示例5: paypal_notify

 /**
  * Handles PayPal IPN processing.
  *
  * These same routines also handle s2Member Pro/PayPal Pro operations;
  * giving you the ability *(as needed)* to Hook into these routines using
  * WordPress Hooks/Filters; as seen in the source code below.
  *
  * Please do NOT modify the source code directly.
  * Instead, use WordPress Hooks/Filters.
  *
  * For example, if you'd like to add your own custom conditionals, use:
  * ``add_filter ("ws_plugin__s2member_during_paypal_notify_conditionals", "your_function");``
  *
  * @package s2Member\PayPal
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after handling IPN procesing.
  */
 public static function paypal_notify()
 {
     global $current_site, $current_blog;
     do_action("ws_plugin__s2member_before_paypal_notify", get_defined_vars());
     if (!empty($_GET["s2member_paypal_notify"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !empty($_REQUEST["s2member_paypal_proxy"]))) {
         @ignore_user_abort(true);
         // Important. Continue processing even if/when the connection is broken by the sending party.
         include_once ABSPATH . "wp-admin/includes/admin.php";
         // Get administrative functions. Needed for `wp_delete_user()`.
         $email_configs_were_on = c_ws_plugin__s2member_email_configs::email_config_status();
         // Filters on?
         c_ws_plugin__s2member_email_configs::email_config_release();
         // Release s2Member Filters.
         $paypal = array();
         // Initialize PayPal array; we also reference this with a variable for a possible proxy handler.
         if (!empty($_REQUEST["s2member_paypal_proxy"]) && in_array($_REQUEST["s2member_paypal_proxy"], array("alipay", "authnet", "clickbank", "ccbill", "google"), TRUE)) {
             ${esc_html(trim(stripslashes($_REQUEST["s2member_paypal_proxy"])))} =& $paypal;
         }
         // Internal alias by reference.
         if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars()) && ($_paypal = $paypal) && ($_paypal_s = serialize($_paypal))) {
             $paypal["s2member_log"][] = "IPN received on: " . date("D M j, Y g:i:s a T");
             $paypal["s2member_log"][] = "s2Member POST vars verified " . (!empty($paypal["proxy_verified"]) ? "with a Proxy Key" : "through a POST back to PayPal.");
             $payment_status_issues = "/^(failed|denied|expired|refunded|partially_refunded|reversed|reversal|canceled_reversal|voided)\$/i";
             $paypal["subscr_gateway"] = !empty($_REQUEST["s2member_paypal_proxy"]) ? esc_html(trim(stripslashes($_REQUEST["s2member_paypal_proxy"]))) : "paypal";
             $coupon = !empty($_REQUEST["s2member_paypal_proxy_coupon"]) && is_array($_REQUEST["s2member_paypal_proxy_coupon"]) ? stripslashes_deep($_REQUEST["s2member_paypal_proxy_coupon"]) : array();
             $coupon = isset($coupon["full_coupon_code"], $coupon["coupon_code"], $coupon["affiliate_id"]) && is_string($coupon["full_coupon_code"]) && is_string($coupon["coupon_code"]) && is_string($coupon["affiliate_id"]) ? $coupon : array("full_coupon_code" => "", "coupon_code" => "", "affiliate_id" => "");
             if (!empty($paypal["txn_type"]) && $paypal["txn_type"] === "merch_pmt") {
                 // This is mostly irrelevant, but it helps to keep the logs cleaner.
                 sleep(5);
             }
             // Wait for Pro Form procesing to complete.
             if (empty($paypal["custom"]) && !empty($paypal["recurring_payment_id"])) {
                 // Recurring Profile ID.
                 $paypal["custom"] = c_ws_plugin__s2member_utils_users::get_user_custom_with($paypal["recurring_payment_id"]);
             } else {
                 if (empty($paypal["custom"]) && !empty($paypal["mp_id"])) {
                     // Lookup; based on a Billing Agreement ID.
                     $paypal["custom"] = c_ws_plugin__s2member_utils_users::get_user_custom_with($paypal["mp_id"]);
                 }
             }
             if (!empty($paypal["custom"]) && preg_match("/^" . preg_quote(preg_replace("/\\:([0-9]+)\$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", $paypal["custom"])) {
                 $paypal["s2member_log"][] = "s2Member originating domain ( `\$_SERVER[\"HTTP_HOST\"]` ) validated.";
                 foreach (array_keys(get_defined_vars()) as $__v) {
                     $__refs[$__v] =& ${$__v};
                 }
                 if (!apply_filters("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars())) {
                     unset($__refs, $__v);
                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_virtual_terminal::cp(get_defined_vars())) {
                         $paypal = $_paypal_cp;
                     } else {
                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_express_checkout::cp(get_defined_vars())) {
                             $paypal = $_paypal_cp;
                         } else {
                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_cart::cp(get_defined_vars())) {
                                 $paypal = $_paypal_cp;
                             } else {
                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_send_money::cp(get_defined_vars())) {
                                     $paypal = $_paypal_cp;
                                 } else {
                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_web_accept_sp::cp(get_defined_vars())) {
                                         $paypal = $_paypal_cp;
                                     } else {
                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_wa_ccaps_wo_level::cp(get_defined_vars())) {
                                             $paypal = $_paypal_cp;
                                         } else {
                                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_wa_w_level::cp(get_defined_vars())) {
                                                 $paypal = $_paypal_cp;
                                             } else {
                                                 if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_rec_profile_creation_w_level::cp(get_defined_vars())) {
                                                     $paypal = $_paypal_cp;
                                                 } else {
                                                     if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_modify_w_level::cp(get_defined_vars())) {
                                                         $paypal = $_paypal_cp;
                                                     } else {
                                                         if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_payment_w_level::cp(get_defined_vars())) {
                                                             $paypal = $_paypal_cp;
                                                         } else {
                                                             if ($_paypal_cp = c_ws_plugin__s2member_paypal_notify_in_subscr_or_rp_payment_failed_w_level::cp(get_defined_vars())) {
                                                                 $paypal = $_paypal_cp;
                                                             } else {
//.........这里部分代码省略.........
开发者ID:donwea,项目名称:nhap.org,代码行数:101,代码来源:paypal-notify-in.inc.php


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