Source Code Documentation


s2member\includes\classes\paypal-notify-in-send-money.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_send_money"))
  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_send_money
  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 ("/^send_money$/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_send_money", 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 ( `send_money` ).";
  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.  
  59. foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
  60. do_action ("ws_plugin__s2member_during_paypal_notify_during_send_money", get_defined_vars ());
  61. unset /* Unset defined __refs, __v. */ ($__refs, $__v);
  62. }
  63. else // Else, this is a duplicate IPN. Must stop here.
  64. {
  65. $paypal["s2member_log"][] = "Not processing. Duplicate IPN.";
  66. $paypal["s2member_log"][] = "s2Member `txn_type` identified as ( `send_money` ).";
  67. $paypal["s2member_log"][] = "Duplicate IPN. Already processed. This IPN will be ignored.";
  68. }
  69.  
  70. foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
  71. do_action ("ws_plugin__s2member_during_paypal_notify_after_send_money", get_defined_vars ());
  72. unset /* Unset defined __refs, __v. */ ($__refs, $__v);
  73.  
  74. return apply_filters ("c_ws_plugin__s2member_paypal_notify_in_send_money", $paypal, get_defined_vars ());
  75. }
  76. else
  77. return apply_filters ("c_ws_plugin__s2member_paypal_notify_in_send_money", false, get_defined_vars ());
  78. }
  79. }
  80. }
  81. ?>

s2member\includes\classes\paypal-notify-in-send-money.inc.php

Source Code Documentation