Source Code Documentation


s2member\includes\classes\paypal-notify-in-express-checkout.inc.php


  1. <?php
  2. /**
  3. * s2Member's PayPal® IPN handler (inner processing routine).
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package s2Member\PayPal
  15. * @since 110720
  16. */
  17. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  18. exit("Do not access this file directly.");
  19.  
  20. if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in_express_checkout"))
  21. {
  22. /**
  23. * s2Member's PayPal® IPN handler (inner processing routine).
  24. *
  25. * @package s2Member\PayPal
  26. * @since 110720
  27. */
  28. class c_ws_plugin__s2member_paypal_notify_in_express_checkout
  29. {
  30. /**
  31. * s2Member's PayPal® IPN handler (inner processing routine).
  32. *
  33. * @package s2Member\PayPal
  34. * @since 110720
  35. *
  36. * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_notify_in::paypal_notify()}.
  37. * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  38. */
  39. public static function cp ($vars = array ()) // Conditional phase for ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``.
  40. {
  41. extract($vars); // Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``.
  42.  
  43. if ((!empty ($paypal["txn_type"]) && preg_match ("/^express_checkout$/i", $paypal["txn_type"]))
  44. && (empty ($paypal["payment_status"]) || empty ($payment_status_issues) || !preg_match ($payment_status_issues, $paypal["payment_status"]))
  45. && (!empty ($paypal["txn_id"])))
  46. {
  47. foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
  48. do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
  49. unset /* Unset defined __refs, __v. */ ($__refs, $__v);
  50.  
  51. if (!get_transient ($transient_ipn = "s2m_ipn_" . md5 ("s2member_transient_" . $_paypal_s)) && set_transient ($transient_ipn, time (), 31556926 * 10))
  52. {
  53. $paypal["s2member_log"][] = "s2Member `txn_type` identified as ( `express_checkout` ).";
  54.  
  55. $processing = $during = true; // Yes, we ARE processing this.
  56.  
  57. $paypal["s2member_log"][] = "The `txn_type` does not require any action on the part of s2Member.";
  58. $paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
  59.  
  60. foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
  61. do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
  62. unset /* Unset defined __refs, __v. */ ($__refs, $__v);
  63. }
  64. else // Else, this is a duplicate IPN. Must stop here.
  65. {
  66. $paypal["s2member_log"][] = "Not processing. Duplicate IPN.";
  67. $paypal["s2member_log"][] = "s2Member `txn_type` identified as ( `express_checkout` ).";
  68. $paypal["s2member_log"][] = "Duplicate IPN. Already processed. This IPN will be ignored.";
  69. }
  70.  
  71. foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
  72. do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
  73. unset /* Unset defined __refs, __v. */ ($__refs, $__v);
  74.  
  75. return apply_filters ("c_ws_plugin__s2member_paypal_notify_in_express_checkout", $paypal, get_defined_vars ());
  76. }
  77. else
  78. return apply_filters ("c_ws_plugin__s2member_paypal_notify_in_express_checkout", false, get_defined_vars ());
  79. }
  80. }
  81. }
  82. ?>

s2member\includes\classes\paypal-notify-in-express-checkout.inc.php

Source Code Documentation