Source Code Documentation


pro\s2member-pro\includes\classes\gateways\paypal\paypal-responses.inc.php


  1. <?php
  2. /**
  3. * PayPal® Pro Form responses.
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * This WordPress® plugin (s2Member Pro) is comprised of two parts:
  10. *
  11. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  12. * You should have received a copy of the GNU General Public License,
  13. * along with this software. In the main directory, see: /licensing/
  14. * If not, see: {@link http://www.gnu.org/licenses/}.
  15. *
  16. * o (2) All other parts of (s2Member Pro); including, but not limited to:
  17. * the CSS code, some JavaScript code, images, and design;
  18. * are licensed according to the license purchased.
  19. * See: {@link http://www.s2member.com/prices/}
  20. *
  21. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  22. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  23. * or make an offer to do any of these things. All of these things are strictly
  24. * prohibited with part (2) of the s2Member Pro Module.
  25. *
  26. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  27. * (i.e. new features, bug fixes, updates, improvements); along with full access
  28. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  29. *
  30. * @package s2Member\PayPal
  31. * @since 1.5
  32. */
  33. if(realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"]))
  34. exit("Do not access this file directly.");
  35.  
  36. if(!class_exists("c_ws_plugin__s2member_pro_paypal_responses"))
  37. {
  38. /**
  39. * PayPal® Pro Form responses.
  40. *
  41. * @package s2Member\PayPal
  42. * @since 1.5
  43. */
  44. class c_ws_plugin__s2member_pro_paypal_responses
  45. {
  46. /**
  47. * Creates response divs after Cancellation processing.
  48. *
  49. * @package s2Member\PayPal
  50. * @since 1.5
  51. *
  52. * @param array $attr An array of Pro Form Attributes.
  53. * @return array An array of response details.
  54. */
  55. public static function paypal_cancellation_response($attr = FALSE)
  56. {
  57. $_response = $GLOBALS["ws_plugin__s2member_pro_paypal_cancellation_response"];
  58.  
  59. $_response = (!$_response) ? c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($attr) : $_response;
  60.  
  61. if /* Error reporting. */($_response && ($error = $_response["error"]))
  62. {
  63. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-error s2member-pro-paypal-cancellation-form-response-error">';
  64. $response .= $_response["response"];
  65. $response .= '</div>';
  66. }
  67. else if /* Otherwise, we treat this as an informational response. */($_response)
  68. {
  69. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-info s2member-pro-paypal-cancellation-form-response-info">';
  70. $response .= $_response["response"];
  71. $response .= '</div>';
  72. }
  73. return array("response" => $response, "error" => $error);
  74. }
  75. /**
  76. * Creates response divs after Update processing.
  77. *
  78. * @package s2Member\PayPal
  79. * @since 1.5
  80. *
  81. * @param array $attr An array of Pro Form Attributes.
  82. * @return array An array of response details.
  83. */
  84. public static function paypal_update_response($attr = FALSE)
  85. {
  86. $_response = $GLOBALS["ws_plugin__s2member_pro_paypal_update_response"];
  87.  
  88. $_response = (!$_response) ? c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($attr) : $_response;
  89.  
  90. if /* Error reporting. */($_response && ($error = $_response["error"]))
  91. {
  92. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-error s2member-pro-paypal-update-form-response-error">';
  93. $response .= $_response["response"];
  94. $response .= '</div>';
  95. }
  96. else if /* Otherwise, we treat this as an informational response. */($_response)
  97. {
  98. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-info s2member-pro-paypal-update-form-response-info">';
  99. $response .= $_response["response"];
  100. $response .= '</div>';
  101. }
  102. return array("response" => $response, "error" => $error);
  103. }
  104. /**
  105. * Creates response divs after Registration processing.
  106. *
  107. * @package s2Member\PayPal
  108. * @since 1.5
  109. *
  110. * @param array $attr An array of Pro Form Attributes.
  111. * @return array An array of response details.
  112. */
  113. public static function paypal_registration_response($attr = FALSE)
  114. {
  115. $_response = $GLOBALS["ws_plugin__s2member_pro_paypal_registration_response"];
  116.  
  117. $_response = (!$_response) ? c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($attr) : $_response;
  118.  
  119. if /* Error reporting. */($_response && ($error = $_response["error"]))
  120. {
  121. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-error s2member-pro-paypal-registration-form-response-error">';
  122. $response .= $_response["response"];
  123. $response .= '</div>';
  124. }
  125. else if /* Otherwise, we treat this as an informational response. */($_response)
  126. {
  127. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-info s2member-pro-paypal-registration-form-response-info">';
  128. $response .= $_response["response"];
  129. $response .= '</div>';
  130. }
  131. return array("response" => $response, "error" => $error);
  132. }
  133. /**
  134. * Creates response divs after Specific Post/Page checkout processing.
  135. *
  136. * @package s2Member\PayPal
  137. * @since 1.5
  138. *
  139. * @param array $attr An array of Pro Form Attributes.
  140. * @return array An array of response details.
  141. */
  142. public static function paypal_sp_checkout_response($attr = FALSE)
  143. {
  144. $_response = $GLOBALS["ws_plugin__s2member_pro_paypal_sp_checkout_response"];
  145.  
  146. $_response = (!$_response) ? c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($attr) : $_response;
  147.  
  148. if /* Error reporting. */($_response && ($error = $_response["error"]))
  149. {
  150. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-error s2member-pro-paypal-sp-checkout-form-response-error">';
  151. $response .= $_response["response"];
  152. $response .= '</div>';
  153. }
  154. else if /* Otherwise, we treat this as an informational response. */($_response)
  155. {
  156. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-info s2member-pro-paypal-sp-checkout-form-response-info">';
  157. $response .= $_response["response"];
  158. $response .= '</div>';
  159. }
  160. return array("response" => $response, "error" => $error);
  161. }
  162. /**
  163. * Creates response divs after Membership checkout processing.
  164. *
  165. * @package s2Member\PayPal
  166. * @since 1.5
  167. *
  168. * @param array $attr An array of Pro Form Attributes.
  169. * @return array An array of response details.
  170. */
  171. public static function paypal_checkout_response($attr = FALSE)
  172. {
  173. $_response = $GLOBALS["ws_plugin__s2member_pro_paypal_checkout_response"];
  174.  
  175. $_response = (!$_response) ? c_ws_plugin__s2member_pro_paypal_responses::paypal_form_attr_validation_errors($attr) : $_response;
  176.  
  177. if /* Error reporting. */($_response && ($error = $_response["error"]))
  178. {
  179. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-error s2member-pro-paypal-checkout-form-response-error">';
  180. $response .= $_response["response"];
  181. $response .= '</div>';
  182. }
  183. else if /* Otherwise, we treat this as an informational response. */($_response)
  184. {
  185. $response = '<div id="s2member-pro-paypal-form-response" class="s2member-pro-paypal-form-response-info s2member-pro-paypal-checkout-form-response-info">';
  186. $response .= $_response["response"];
  187. $response .= '</div>';
  188. }
  189. return array("response" => $response, "error" => $error);
  190. }
  191. /**
  192. * Validates the configuration of API Credentials.
  193. *
  194. * Free Registration Forms do NOT require API Credentials.
  195. *
  196. * @package s2Member\PayPal
  197. * @since 1.5
  198. *
  199. * @param array $attr An array of Pro Form Attributes.
  200. * @return null|array Null if there are no errors, else a response array.
  201. */
  202. public static function paypal_form_api_validation_errors($attr = FALSE)
  203. {
  204. if(!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
  205. $response = array("response" => _x('PayPal® configuration error. Please configure your PayPal® Email Address.', "s2member-admin", "s2member"), "error" => true);
  206.  
  207. else if(!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"])
  208. $response = array("response" => _x('PayPal® configuration error. Your PayPal® API Username is not yet configured.', "s2member-admin", "s2member"), "error" => true);
  209.  
  210. else if(!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"])
  211. $response = array("response" => _x('PayPal® configuration error. Your PayPal® API Password is not yet configured.', "s2member-admin", "s2member"), "error" => true);
  212.  
  213. else if(!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"])
  214. $response = array("response" => _x('PayPal® configuration error. Your PayPal® API Signature is not yet configured.', "s2member-admin", "s2member"), "error" => true);
  215.  
  216. return (empty($response) || !empty($attr["register"])) ? null : $response;
  217. }
  218. /**
  219. * Validates the configuration of the current form.
  220. *
  221. * Free Registration Forms do NOT require API Credentials.
  222. *
  223. * @package s2Member\PayPal
  224. * @since 1.5
  225. *
  226. * @param array $attr An array of Pro Form Attributes.
  227. * @return null|array Null if there are no errors, else a response array.
  228. */
  229. public static function paypal_form_attr_validation_errors($attr = FALSE)
  230. {
  231. if(!($response = c_ws_plugin__s2member_pro_paypal_responses::paypal_form_api_validation_errors($attr)) || !empty($attr["register"]))
  232. {
  233. if /* Special form for Cancellations. User/Member must be logged in. */($attr["cancel"])
  234. {
  235. if(!is_user_logged_in())
  236. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">log in</a> to cancel your account.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  237.  
  238. else if(!is_object($user = wp_get_current_user()) || !($user_id = $user->ID) || !($subscr_id = get_user_option("s2member_subscr_id", $user_id)))
  239. $response = array("response" => _x('Nothing to cancel. You\'re NOT a paid Member.', "s2member-front", "s2member"), "error" => true);
  240.  
  241. else if($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_username"])
  242. {
  243. if(!($paypal = c_ws_plugin__s2member_pro_paypal_utilities::payflow_get_profile($subscr_id)))
  244. $response = array("response" => _x('Nothing to cancel. You have NO recurring fees.', "s2member-front", "s2member"), "error" => true);
  245.  
  246. else if(preg_match("/^(Pending|PendingProfile)$/i", $paypal["STATUS"]))
  247. $response = array("response" => _x('<strong>Unable to cancel at this time.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
  248.  
  249. else if(!preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)$/i", $paypal["STATUS"]))
  250. $response = array("response" => _x('Nothing to cancel. You have NO recurring fees.', "s2member-front", "s2member"), "error" => true);
  251. }
  252. else if(is_array($paypal = array("PROFILEID" => $subscr_id, "METHOD" => "GetRecurringPaymentsProfileDetails")))
  253. {
  254. if(!($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal)) || !empty($paypal["__error"]))
  255. {
  256. if($paypal && !empty($paypal["__error"]) && /* Subscription Profile? */$paypal["L_ERRORCODE0"] === "11592")
  257. $response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal®</a> to cancel your Subscription.', "s2member-front", "s2member"), esc_attr("https://".(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")."/cgi-bin/webscr?cmd=_subscr-find&amp;alias=".urlencode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]))), "error" => true);
  258.  
  259. else // Else there was no Recurring Profile on record.
  260. $response = array("response" => _x('Nothing to cancel. You have NO recurring fees.', "s2member-front", "s2member"), "error" => true);
  261. }
  262. else if(preg_match("/^(Pending|PendingProfile)$/i", $paypal["STATUS"]))
  263. $response = array("response" => _x('<strong>Unable to cancel at this time.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
  264.  
  265. else if(!preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)$/i", $paypal["STATUS"]))
  266. $response = array("response" => _x('Nothing to cancel. You have NO recurring fees.', "s2member-front", "s2member"), "error" => true);
  267. }
  268. }
  269. else if /* Special form for Updates. User/Member must be logged in. */($attr["update"])
  270. {
  271. if(!is_user_logged_in())
  272. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">log in</a> to update your billing information.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  273.  
  274. else if(!is_object($user = wp_get_current_user()) || !($user_id = $user->ID) || !($subscr_id = get_user_option("s2member_subscr_id", $user_id)))
  275. $response = array("response" => _x('Nothing to update. You\'re NOT a paid Member.', "s2member-front", "s2member"), "error" => true);
  276.  
  277. else if($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_username"])
  278. {
  279. if(!($paypal = c_ws_plugin__s2member_pro_paypal_utilities::payflow_get_profile($subscr_id)))
  280. $response = array("response" => _x('Nothing to update. You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', "s2member-front", "s2member"), "error" => true);
  281.  
  282. else if(strtoupper($paypal["TENDER"]) === "P")
  283. $response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal®</a> to update your billing information.', "s2member-front", "s2member"), esc_attr("https://".(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")."/")), "error" => true);
  284.  
  285. else if(preg_match("/^(Pending|PendingProfile)$/i", $paypal["STATUS"]))
  286. $response = array("response" => _x('<strong>Unable to update at this time.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
  287.  
  288. else if(!preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)$/i", $paypal["STATUS"]))
  289. $response = array("response" => _x('Nothing to update. You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', "s2member-front", "s2member"), "error" => true);
  290. }
  291. else if(is_array($paypal = array("PROFILEID" => $subscr_id, "METHOD" => "GetRecurringPaymentsProfileDetails")))
  292. {
  293. if(!($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal)) || !empty($paypal["__error"]) || strlen($paypal["ACCT"]) !== 4)
  294. {
  295. if($paypal && empty($paypal["__error"]) && /* It's NOT associated with a credit card; they used PayPal®. */ strlen($paypal["ACCT"]) !== 4)
  296. $response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal®</a> to update your billing information.', "s2member-front", "s2member"), esc_attr("https://".(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")."/")), "error" => true);
  297.  
  298. else if($paypal && !empty($paypal["__error"]) && /* Subscription Profile? */ $paypal["L_ERRORCODE0"] === "11592")
  299. $response = array("response" => sprintf(_x('Please <a href="%s" rel="nofollow">log in at PayPal®</a> to update your billing information.', "s2member-front", "s2member"), esc_attr("https://".(($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")."/")), "error" => true);
  300.  
  301. else // Else there was no Recurring Profile on record.
  302. $response = array("response" => _x('Nothing to update. You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', "s2member-front", "s2member"), "error" => true);
  303. }
  304. else if(preg_match("/^(Pending|PendingProfile)$/i", $paypal["STATUS"]))
  305. $response = array("response" => _x('<strong>Unable to update at this time.</strong> Your account is pending other changes. Please try again in 15 minutes.', "s2member-front", "s2member"), "error" => true);
  306.  
  307. else if(!preg_match("/^(Active|ActiveProfile|Suspended|SuspendedProfile)$/i", $paypal["STATUS"]))
  308. $response = array("response" => _x('Nothing to update. You have NO recurring fees. Or, your billing profile is no longer active. Please contact Support if you need assistance.', "s2member-front", "s2member"), "error" => true);
  309. }
  310. }
  311. else if /* Free Registration does not require attr validation. */($attr["register"])
  312. {
  313. if(!is_string($attr["level"]) || !is_numeric($attr["level"]))
  314. $response = array("response" => sprintf(_x('Invalid form configuration. Missing "level" attribute. Membership Level. Must be numeric [0-%s].', "s2member-admin", "s2member"), esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])), "error" => true);
  315.  
  316. else if($attr["level"] < 0 || $attr["level"] > $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])
  317. $response = array("response" => sprintf(_x('Invalid form configuration. Invalid "level" attribute. Membership Level. Must be numeric [0-%s].', "s2member-admin", "s2member"), esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])), "error" => true);
  318.  
  319. else if($attr["ccaps"] && (!is_string($attr["ccaps"]) || (preg_replace("/^-all[\r\n\t\s;,]*/", "", str_replace("+", "", $attr["ccaps"])) && !preg_match("/^([a-z_0-9,]+)$/", preg_replace("/^-all[\r\n\t\s;,]*/", "", str_replace("+", "", $attr["ccaps"]))))))
  320. $response = array("response" => _x('Invalid form configuration. Invalid "ccaps" attribute. Custom Capabilities. When provided, must be all lowercase [a-z_0-9,]. A preceding `-all,` directive is also acceptable.', "s2member-admin", "s2member"), "error" => true);
  321.  
  322. else if($attr["tp"] && (!is_string($attr["tp"]) || !is_numeric($attr["tp"])))
  323. $response = array("response" => _x('Invalid form configuration. Invalid "tp" attribute. The Trial Period. When provided, must be numeric.', "s2member-admin", "s2member"), "error" => true);
  324.  
  325. else if($attr["tp"] && $attr["tp"] < 1)
  326. $response = array("response" => _x('Invalid form configuration. Invalid "tp" attribute. The Trial Period. When provided, must be >= 1.', "s2member-admin", "s2member"), "error" => true);
  327.  
  328. else if($attr["tp"] && (!$attr["tt"] || !is_string($attr["tt"])))
  329. $response = array("response" => _x('Invalid form configuration. Missing "tt" attribute. The Trial Term. When "tp" is provided, "tt" (Trial Term) must be one of D,W,M,Y.', "s2member-admin", "s2member"), "error" => true);
  330.  
  331. else if($attr["tp"] && !preg_match("/[DWMY]/", $attr["tt"]))
  332. $response = array("response" => _x('Invalid form configuration. Invalid "tt" attribute. The Trial Term. When "tp" is provided, "tt" (Trial Term) must be one of D,W,M,Y.', "s2member-admin", "s2member"), "error" => true);
  333.  
  334. else if($attr["custom"] && (!is_string($attr["custom"]) || !preg_match("/^".preg_quote(preg_replace("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/")."/i", $attr["custom"])))
  335. $response = array("response" => _x('Invalid form configuration. Invalid "custom" attribute. When provided, must start with your domain name.', "s2member-admin", "s2member-admin"), "error" => true);
  336. }
  337. else if /* Validation routines for Specific Post/Page checkout forms. */($attr["sp"])
  338. {
  339. if(!$attr["ids"] || !is_string($attr["ids"]))
  340. $response = array("response" => _x('Invalid form configuration. Missing "ids" attribute. Must contain comma-delimited Post/Page IDs.', "s2member-admin", "s2member"), "error" => true);
  341.  
  342. else if(!preg_match("/^([0-9,]+)$/", $attr["ids"]))
  343. $response = array("response" => _x('Invalid form configuration. Invalid "ids" attribute. Must contain comma-delimited Post/Page IDs. Must contain [0-9,] only.', "s2member-admin", "s2member"), "error" => true);
  344.  
  345. else if(!$attr["exp"] || !is_string($attr["exp"]))
  346. $response = array("response" => _x('Invalid form configuration. Missing "exp" attribute. Specific Post/Page Expiration (in hours). Must be numeric.', "s2member-admin", "s2member"), "error" => true);
  347.  
  348. else if(!is_numeric($attr["exp"]))
  349. $response = array("response" => _x('Invalid form configuration. Invalid "exp" attribute. Specific Post/Page Expiration (in hours). Must be numeric.', "s2member-admin", "s2member"), "error" => true);
  350.  
  351. else if($attr["exp"] < 1)
  352. $response = array("response" => _x('Invalid form configuration. Invalid "exp" attribute. Specific Post/Page Expiration (in hours). Must be >= 1.', "s2member-admin", "s2member"), "error" => true);
  353.  
  354. else if($attr["exp"] > 43800)
  355. $response = array("response" => _x('Invalid form configuration. Invalid "exp" attribute. Specific Post/Page Expiration (in hours). Must be <= 43800.', "s2member-admin", "s2member"), "error" => true);
  356.  
  357. else if(!$attr["sp_ids_exp"] || !is_string($attr["sp_ids_exp"]))
  358. $response = array("response" => _x('Invalid form configuration. Missing "sp_ids_exp" internal attribute. Please check Shortcode Attributes.', "s2member-admin", "s2member"), "error" => true);
  359.  
  360. else if(!preg_match($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $attr["sp_ids_exp"]))
  361. $response = array("response" => _x('Invalid form configuration. Invalid "sp_ids_exp" internal attribute. Please check Shortcode Attributes.', "s2member-admin", "s2member"), "error" => true);
  362.  
  363. else if(!$attr["desc"] || !is_string($attr["desc"]))
  364. $response = array("response" => _x('Invalid form configuration. Missing "desc" attribute. Please provide a Description for this form.', "s2member-admin", "s2member"), "error" => true);
  365.  
  366. else if(strlen($attr["desc"]) > 100 /* Actually, this can be 127 chars; but we need plenty of room for s2Member's coupon info. */)
  367. $response = array("response" => _x('Invalid form configuration. Your "desc" (Description) attribute must be <= 100 characters long.', "s2member-admin", "s2member"), "error" => true);
  368.  
  369. else if(!$attr["custom"] || !is_string($attr["custom"]))
  370. $response = array("response" => _x('Invalid form configuration. Missing "custom" attribute. Must start with your domain name.', "s2member-admin", "s2member"), "error" => true);
  371.  
  372. else if(!preg_match("/^".preg_quote(preg_replace("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/")."/i", $attr["custom"]))
  373. $response = array("response" => _x('Invalid form configuration. Invalid "custom" attribute. Must start with your domain name.', "s2member-admin", "s2member"), "error" => true);
  374.  
  375. else if(!$attr["cc"] || !is_string($attr["cc"]))
  376. $response = array("response" => _x('Invalid form configuration. Missing "cc" attribute. Must be a 3 character Currency Code.', "s2member-admin", "s2member"), "error" => true);
  377.  
  378. else if(strlen($attr["cc"]) !== 3)
  379. $response = array("response" => _x('Invalid form configuration. Invalid "cc" attribute. Must be a 3 character Currency Code.', "s2member-admin", "s2member"), "error" => true);
  380.  
  381. else if(!strlen($attr["dg"]) || !is_string($attr["dg"]))
  382. $response = array("response" => _x('Invalid form configuration. Missing "dg" attribute. Digital indicator. Must be numeric [0-1].', "s2member-admin", "s2member"), "error" => true);
  383.  
  384. else if($attr["dg"] < 0 || $attr["dg"] > 1)
  385. $response = array("response" => _x('Invalid form configuration. Invalid "dg" attribute. Digital indicator. Must be numeric [0-1].', "s2member-admin", "s2member"), "error" => true);
  386.  
  387. else if(!strlen($attr["ns"]) || !is_string($attr["ns"]))
  388. $response = array("response" => _x('Invalid form configuration. Missing "ns" attribute. Shipping configuration. Must be numeric [0-2].', "s2member-admin", "s2member"), "error" => true);
  389.  
  390. else if($attr["ns"] < 0 || $attr["ns"] > 2)
  391. $response = array("response" => _x('Invalid form configuration. Invalid "ns" attribute. Shipping configuration. Must be numeric [0-2].', "s2member-admin", "s2member"), "error" => true);
  392.  
  393. else if($attr["dg"] && $attr["ns"] !== "1")
  394. $response = array("response" => _x('Invalid form configuration. Invalid "ns" attribute. Shipping configuration. Must be 1 with "dg" (digital) items.', "s2member-admin", "s2member"), "error" => true);
  395.  
  396. else if($attr["lc"] && strlen($attr["lc"]) !== 2)
  397. $response = array("response" => _x('Invalid form configuration. Invalid "lc" attribute. Locale Code. When provided, must be a 2 character country code.', "s2member-admin", "s2member"), "error" => true);
  398.  
  399. else if(!$attr["ra"] || !is_string($attr["ra"]))
  400. $response = array("response" => _x('Invalid form configuration. Missing "ra" attribute. The Regular Amount. Must be >= 0.01.', "s2member-admin", "s2member"), "error" => true);
  401.  
  402. else if(!is_numeric($attr["ra"]))
  403. $response = array("response" => _x('Invalid form configuration. Invalid "ra" attribute. The Regular Amount. Must be numeric.', "s2member-admin", "s2member"), "error" => true);
  404.  
  405. else if($attr["ra"] < 0.01)
  406. $response = array("response" => _x('Invalid form configuration. Invalid "ra" attribute. The Regular Amount. Must be >= 0.01.', "s2member-admin", "s2member"), "error" => true);
  407.  
  408. else if($attr["ra"] > 10000.00 && strtoupper($attr["cc"]) === "USD")
  409. $response = array("response" => _x('Invalid form configuration. Invalid "ra" attribute. The Regular Amount. Must be <= 10000.00.', "s2member-admin", "s2member"), "error" => true);
  410. }
  411. else // Validation routines for Member Level checkout forms. This is the default functionality.
  412. {
  413. if /* Must be logged in before a modification can take place. */($attr["modify"] && !is_user_logged_in())
  414. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">login</a> to update your billing plan.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  415.  
  416. else if /* Must be logged in before purchasing. */($attr["level"] === "*" && !is_user_logged_in())
  417. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">login</a> before making this purchase.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  418.  
  419. else if((!$attr["level"] || !is_string($attr["level"]) || !is_numeric($attr["level"])) && $attr["level"] !== "*")
  420. $response = array("response" => sprintf(_x('Invalid form configuration. Missing "level" attribute. Membership Level. Must be numeric [1-%s], or an asterisk (*).', "s2member-admin", "s2member"), esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])), "error" => true);
  421.  
  422. else if(($attr["level"] < 1 || $attr["level"] > $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) && $attr["level"] !== "*")
  423. $response = array("response" => sprintf(_x('Invalid form configuration. Invalid "level" attribute. Membership Level. Must be numeric [1-%s], or an asterisk (*).', "s2member-admin", "s2member"), esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])), "error" => true);
  424.  
  425. else if($attr["ccaps"] && (!is_string($attr["ccaps"]) || (preg_replace("/^-all[\r\n\t\s;,]*/", "", str_replace("+", "", $attr["ccaps"])) && !preg_match("/^([a-z_0-9,]+)$/", preg_replace("/^-all[\r\n\t\s;,]*/", "", str_replace("+", "", $attr["ccaps"]))))))
  426. $response = array("response" => _x('Invalid form configuration. Invalid "ccaps" attribute. Custom Capabilities. When provided, must be all lowercase [a-z_0-9,]. A preceding `-all,` directive is also acceptable.', "s2member-admin", "s2member"), "error" => true);
  427.  
  428. else if($attr["level"] === "*" && (!is_string($attr["ccaps"]) || !preg_replace("/^-all[\r\n\t\s;,]*/", "", str_replace("+", "", $attr["ccaps"])) || !preg_match("/^([a-z_0-9,]+)$/", preg_replace("/^-all[\r\n\t\s;,]*/", "", str_replace("+", "", $attr["ccaps"])))))
  429. $response = array("response" => _x('Invalid form configuration. Missing or invalid "ccaps" attribute. When "level" is "*" for (Independent Custom Capabilities), "ccaps" is required. All lowercase [a-z_0-9,]. A preceding `-all,` directive is also acceptable.', "s2member-admin", "s2member"), "error" => true);
  430.  
  431. else if(!$attr["desc"] || !is_string($attr["desc"]))
  432. $response = array("response" => _x('Invalid form configuration. Missing "desc" attribute. Please provide a Description for this form.', "s2member-admin", "s2member"), "error" => true);
  433.  
  434. else if(strlen($attr["desc"]) > 100 /* Actually, this can be 127 chars; but we need plenty of room for s2Member's coupon info. */)
  435. $response = array("response" => _x('Invalid form configuration. Your "desc" (Description) attribute must be <= 100 characters long.', "s2member-admin", "s2member"), "error" => true);
  436.  
  437. else if(!$attr["custom"] || !is_string($attr["custom"]))
  438. $response = array("response" => _x('Invalid form configuration. Missing "custom" attribute. Must start with your domain name.', "s2member-admin", "s2member"), "error" => true);
  439.  
  440. else if(!preg_match("/^".preg_quote(preg_replace("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/")."/i", $attr["custom"]))
  441. $response = array("response" => _x('Invalid form configuration. Invalid "custom" attribute. Must start with matching domain.', "s2member-admin", "s2member"), "error" => true);
  442.  
  443. else if(!$attr["cc"] || !is_string($attr["cc"]))
  444. $response = array("response" => _x('Invalid form configuration. Missing "cc" attribute. Must be a 3 character Currency Code.', "s2member-admin", "s2member"), "error" => true);
  445.  
  446. else if(strlen($attr["cc"]) !== 3)
  447. $response = array("response" => _x('Invalid form configuration. Invalid "cc" attribute. Must be a 3 character Currency Code.', "s2member-admin", "s2member"), "error" => true);
  448.  
  449. else if(!strlen($attr["dg"]) || !is_string($attr["dg"]))
  450. $response = array("response" => _x('Invalid form configuration. Missing "dg" attribute. Digital indicator. Must be numeric [0-1].', "s2member-admin", "s2member"), "error" => true);
  451.  
  452. else if($attr["dg"] < 0 || $attr["dg"] > 1)
  453. $response = array("response" => _x('Invalid form configuration. Invalid "dg" attribute. Digital indicator. Must be numeric [0-1].', "s2member-admin", "s2member"), "error" => true);
  454.  
  455. else if(!strlen($attr["ns"]) || !is_string($attr["ns"]))
  456. $response = array("response" => _x('Invalid form configuration. Missing "ns" attribute. Shipping configuration. Must be numeric [0-2].', "s2member-admin", "s2member"), "error" => true);
  457.  
  458. else if($attr["ns"] < 0 || $attr["ns"] > 2)
  459. $response = array("response" => _x('Invalid form configuration. Invalid "ns" attribute. Shipping configuration. Must be numeric [0-2].', "s2member-admin", "s2member"), "error" => true);
  460.  
  461. else if($attr["dg"] && $attr["ns"] !== "1")
  462. $response = array("response" => _x('Invalid form configuration. Invalid "ns" attribute. Shipping configuration. Must be 1 with "dg" (digital) items.', "s2member-admin", "s2member"), "error" => true);
  463.  
  464. else if($attr["lc"] && strlen($attr["lc"]) !== 2)
  465. $response = array("response" => _x('Invalid form configuration. Invalid "lc" attribute. Locale Code. When provided, must be a 2 character country code.', "s2member-admin", "s2member"), "error" => true);
  466.  
  467. else if($attr["tp"] && (!is_string($attr["tp"]) || !is_numeric($attr["tp"])))
  468. $response = array("response" => _x('Invalid form configuration. Invalid "tp" attribute. The Trial Period. When provided, must be numeric.', "s2member-admin", "s2member"), "error" => true);
  469.  
  470. else if($attr["tp"] && $attr["tp"] < 1)
  471. $response = array("response" => _x('Invalid form configuration. Invalid "tp" attribute. The Trial Period. When provided, must be >= 1.', "s2member-admin", "s2member"), "error" => true);
  472.  
  473. else if($attr["tp"] && (!$attr["tt"] || !is_string($attr["tt"])))
  474. $response = array("response" => _x('Invalid form configuration. Missing "tt" attribute. The Trial Term. When "tp" is provided, "tt" (Trial Term) must be one of D,W,M,Y.', "s2member-admin", "s2member"), "error" => true);
  475.  
  476. else if($attr["tp"] && !preg_match("/[DWMY]/", $attr["tt"]))
  477. $response = array("response" => _x('Invalid form configuration. Invalid "tt" attribute. The Trial Term. When "tp" is provided, "tt" (Trial Term) must be one of D,W,M,Y.', "s2member-admin", "s2member"), "error" => true);
  478.  
  479. else if($attr["tp"] && $attr["ta"] && !is_numeric($attr["ta"]))
  480. $response = array("response" => _x('Invalid form configuration. Invalid "ta" attribute. The Trial Amount. When provided, must be numeric.', "s2member-admin", "s2member"), "error" => true);
  481.  
  482. else if($attr["tp"] && $attr["ta"] && $attr["ta"] < 0.00)
  483. $response = array("response" => _x('Invalid form configuration. Invalid "ta" attribute. The Trial Amount. When provided, must be >= 0.00.', "s2member-admin", "s2member"), "error" => true);
  484.  
  485. else if($attr["tp"] && $attr["ta"] && $attr["ta"] > 10000.00 && strtoupper($attr["cc"]) === "USD")
  486. $response = array("response" => _x('Invalid form configuration. Invalid "ta" attribute. The Trial Amount. When provided, must be <= 10000.00.', "s2member-admin", "s2member"), "error" => true);
  487.  
  488. else if(!$attr["rp"] || !is_string($attr["rp"]))
  489. $response = array("response" => _x('Invalid form configuration. Missing "rp" attribute. The Regular Period. Must be >= 1.', "s2member-admin", "s2member"), "error" => true);
  490.  
  491. else if(!is_numeric($attr["rp"]))
  492. $response = array("response" => _x('Invalid form configuration. Invalid "rp" attribute. The Regular Period. Must be numeric.', "s2member-admin", "s2member"), "error" => true);
  493.  
  494. else if($attr["rp"] < 1)
  495. $response = array("response" => _x('Invalid form configuration. Invalid "rp" attribute. The Regular Period. Must be >= 1.', "s2member-admin", "s2member"), "error" => true);
  496.  
  497. else if(!$attr["rt"] || !is_string($attr["rt"]))
  498. $response = array("response" => _x('Invalid form configuration. Missing "rt" attribute. The Regular Term. Must be one of D,W,M,Y,L.', "s2member-admin", "s2member"), "error" => true);
  499.  
  500. else if(!preg_match("/[DWMYL]/", $attr["rt"]))
  501. $response = array("response" => _x('Invalid form configuration. Invalid "rt" attribute. The Regular Term. Must be one of D,W,M,Y,L.', "s2member-admin", "s2member"), "error" => true);
  502.  
  503. else if($attr["rt"] === "D" && $attr["rp"] > 365 && $attr["rr"] !== "BN")
  504. $response = array("response" => _x('Invalid form configuration. Invalid "rt, rp, rr" attributes. The "rt" (Regular Term) attribute is "D", "rp" (Regular Period) > 365, and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  505.  
  506. else if($attr["rt"] === "W" && $attr["rp"] > 52 && $attr["rr"] !== "BN")
  507. $response = array("response" => _x('Invalid form configuration. Invalid "rt, rp, rr" attributes. The "rt" (Regular Term) attribute is "W", "rp" (Regular Period) > 52, and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  508.  
  509. else if($attr["rt"] === "M" && $attr["rp"] > 12 && $attr["rr"] !== "BN")
  510. $response = array("response" => _x('Invalid form configuration. Invalid "rt, rp, rr" attributes. The "rt" (Regular Term) attribute is "M", "rp" (Regular Period) > 12, and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  511.  
  512. else if($attr["rr"] !== "BN" && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_payflow_api_username"] && !in_array($attr["rp"]."-".$attr["rt"], array("1-D", "1-W", "2-W", "1-M", "3-M", "6-M", "1-Y"), TRUE)) // We allow daily here in case Payflow begins to support this in the future.
  513. $response = array("response" => _x('Invalid Payflow® form configuration. Invalid "rt, rp, rr" attributes. Payflow® supports a specific set of recurring intervals. Pro Forms can be configured to charge: weekly, bi-weekly, monthly, quarterly, semi-yearly or yearly. Any other combination results in this error. This is a Payflow® limitation.', "s2member-admin", "s2member"), "error" => true);
  514.  
  515. else if($attr["rt"] === "Y" && $attr["rp"] > 5 && $attr["rr"] !== "BN")
  516. $response = array("response" => _x('Invalid form configuration. Invalid "rt, rp, rr" attributes. The "rt" (Regular Term) attribute is "Y", "rp" (Regular Period) > 5, and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  517.  
  518. else if($attr["rt"] === "Y" && $attr["rp"] > 1 && $attr["rr"] !== "BN")
  519. $response = array("response" => _x('Invalid form configuration. Invalid "rt, rp, rr" attributes. The "rt" (Regular Term) attribute is "Y", "rp" (Regular Period) > 1, and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  520.  
  521. else if($attr["rt"] === "L" && $attr["rp"] > 1)
  522. $response = array("response" => _x('Invalid form configuration. Invalid "rp, rt" attributes. The "rt" (Regular Term) attribute is "L" (Lifetime), and "rp" (Regular Period) > 1.', "s2member-admin", "s2member"), "error" => true);
  523.  
  524. else if($attr["rt"] === "L" && $attr["rr"] !== "BN")
  525. $response = array("response" => _x('Invalid form configuration. Invalid "rt, rr" attributes. The "rt" (Regular Term) attribute is "L" (Lifetime), and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  526.  
  527. else if(!$attr["level_ccaps_eotper"] || !is_string($attr["level_ccaps_eotper"]))
  528. $response = array("response" => _x('Invalid form configuration. Missing "level_ccaps_eotper" attribute. Please check Shortcode Attributes.', "s2member-admin", "s2member"), "error" => true);
  529.  
  530. else if($attr["level"] !== "*" && !preg_match($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_w_level_regex"], $attr["level_ccaps_eotper"]))
  531. $response = array("response" => _x('Invalid form configuration. Invalid "level_ccaps_eotper" attribute. Please check Shortcode Attributes.', "s2member-admin", "s2member"), "error" => true);
  532.  
  533. else if($attr["level"] === "*" && !preg_match($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_wo_level_regex"], $attr["level_ccaps_eotper"]))
  534. $response = array("response" => _x('Invalid form configuration. Invalid "level_ccaps_eotper" attribute. Please check Shortcode Attributes.', "s2member-admin", "s2member"), "error" => true);
  535.  
  536. else if(!$attr["ra"] || !is_string($attr["ra"]))
  537. $response = array("response" => _x('Invalid form configuration. Missing "ra" attribute. The Regular Amount. Must be >= 0.01.', "s2member-admin", "s2member"), "error" => true);
  538.  
  539. else if(!is_numeric($attr["ra"]))
  540. $response = array("response" => _x('Invalid form configuration. Invalid "ra" attribute. The Regular Amount. Must be numeric.', "s2member-admin", "s2member"), "error" => true);
  541.  
  542. else if($attr["ra"] < 0.01)
  543. $response = array("response" => _x('Invalid form configuration. Invalid "ra" attribute. The Regular Amount. Must be >= 0.01.', "s2member-admin", "s2member"), "error" => true);
  544.  
  545. else if($attr["ra"] > 10000.00 && strtoupper($attr["cc"]) === "USD")
  546. $response = array("response" => _x('Invalid form configuration. Invalid "ra" attribute. The Regular Amount. Must be <= 10000.00.', "s2member-admin", "s2member"), "error" => true);
  547.  
  548. else if($attr["rr"] && (!is_string($attr["rr"]) || !preg_match("/^([0-1]|BN)$/", $attr["rr"])))
  549. $response = array("response" => _x('Invalid form configuration. Invalid "rr" attribute. Regular Recurring. When provided, must be 0, 1, or BN.', "s2member-admin", "s2member"), "error" => true);
  550.  
  551. else if($attr["rr"] === "BN" && $attr["tp"])
  552. $response = array("response" => _x('Invalid form configuration. Invalid "rr, tp" attributes. The "rr" (Regular Recurring) attribute is "BN" (Buy Now), and "tp" (Trial Period) is not "0".', "s2member-admin", "s2member"), "error" => true);
  553.  
  554. else if($attr["level"] === "*" && $attr["rr"] !== "BN")
  555. $response = array("response" => _x('Invalid form configuration. Invalid "level, rr" attributes. The "level" (Level) attribute is "*" for (Independent Custom Capabilities), and "rr" is not "BN" (Buy Now).', "s2member-admin", "s2member"), "error" => true);
  556.  
  557. else if($attr["ta"] === $attr["ra"] && $attr["tp"] === $attr["rp"] && $attr["tt"] === $attr["rt"])
  558. $response = array("response" => _x('Invalid form configuration. Invalid "ta, tp, tt" attributes. Trial Period. When provided, these cannot be exactly the same as your "ra, rp, rt" attributes.', "s2member-admin", "s2member"), "error" => true);
  559.  
  560. else if($attr["rrt"] && (!is_string($attr["rrt"]) || !is_numeric($attr["rrt"])))
  561. $response = array("response" => _x('Invalid form configuration. Invalid "rrt" attribute. Recurring Times (fixed). When provided, must be numeric.', "s2member-admin", "s2member"), "error" => true);
  562.  
  563. else if($attr["rrt"] && $attr["rrt"] < 1)
  564. $response = array("response" => _x('Invalid form configuration. Invalid "rrt" attribute. Recurring Times (fixed). When provided, must be >= 1.', "s2member-admin", "s2member"), "error" => true);
  565.  
  566. else if($attr["rrt"] && $attr["rr"] !== "1")
  567. $response = array("response" => _x('Invalid form configuration. Invalid "rr, rrt" attributes. When "rrt" (Recurring Times) is provided, "rr" (Regular Recurring) must be 1.', "s2member-admin", "s2member"), "error" => true);
  568.  
  569. else if(($attr["rr"] === "0" || $attr["rr"] === "1") && (!is_string($attr["rra"]) || !is_numeric($attr["rra"])))
  570. $response = array("response" => _x('Invalid form configuration. Invalid "rr, rra" attributes. When "rr" (Regular Recurring) is 0 or 1, "rra" (Recurring Retry Attempts) must be numeric.', "s2member-admin", "s2member"), "error" => true);
  571.  
  572. else if(($attr["rr"] === "0" || $attr["rr"] === "1") && $attr["rra"] < 0)
  573. $response = array("response" => _x('Invalid form configuration. Invalid "rr, rra" attributes. When "rr" (Regular Recurring) is 0 or 1, "rra" (Recurring Retry Attempts) must be >= 0.', "s2member-admin", "s2member"), "error" => true);
  574. }
  575. }
  576. return (empty($response)) ? null : $response;
  577. }
  578. /**
  579. * Validates different kinds of form submissions.
  580. *
  581. * Free Registration Forms do NOT require API Credentials.
  582. *
  583. * @package s2Member\PayPal
  584. * @since 1.5
  585. *
  586. * @param str $form The type of Pro Form being submitted.
  587. * @param array $s An array of data submitted through the Pro Form.
  588. * @return null|array Null if there are no errors, else a response array.
  589. */
  590. public static function paypal_form_submission_validation_errors($form = FALSE, $s = FALSE)
  591. {
  592. if($form === "registration" || !($response = c_ws_plugin__s2member_pro_paypal_responses::paypal_form_api_validation_errors()))
  593. {
  594. if /* Special form for Cancellations. User/Member must be logged in. */($form === "cancellation")
  595. {
  596. if(!is_user_logged_in())
  597. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">log in</a> to cancel your account.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  598. // -----------------------------------------------------------------------------------------------------------------
  599. else if($s["attr"]["captcha"] && (!$s["recaptcha_challenge_field"] || !$s["recaptcha_response_field"] || !c_ws_plugin__s2member_utils_captchas::recaptcha_code_validates($s["recaptcha_challenge_field"], $s["recaptcha_response_field"])))
  600. $response = array("response" => _x('Missing or invalid Security Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  601. // -----------------------------------------------------------------------------------------------------------------
  602. else if(is_object($user = wp_get_current_user()) && $user->ID && $user->has_cap("administrator")) // NOT for Administrators.
  603. $response = array("response" => _x('Unable to process. You are an Administrator. Stopping here for security. Otherwise, an Administrator could lose access.', "s2member-admin", "s2member"), "error" => true);
  604. }
  605. else if /* Special form for Updates. User/Member must be logged in. */($form === "update")
  606. {
  607. if(!is_user_logged_in())
  608. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">log in</a> to update your billing information.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  609. // -----------------------------------------------------------------------------------------------------------------
  610. else if(is_object($user = wp_get_current_user()) && $user->ID && /* NOT for Administrators. */ $user->has_cap("administrator"))
  611. $response = array("response" => _x('Unable to process. You are an Administrator. Stopping here for security. Otherwise, an Administrator could lose access.', "s2member-admin", "s2member"), "error" => true);
  612. // -----------------------------------------------------------------------------------------------------------------
  613. else if(!$s["card_type"] || !is_string($s["card_type"]))
  614. $response = array("response" => _x('Missing Card Type (Billing Method). Please try again.', "s2member-front", "s2member"), "error" => true);
  615.  
  616. else if(!in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo", "PayPal")) || !is_array($s["attr"]["accept"]) || !in_array(strtolower($s["card_type"]), $s["attr"]["accept"]))
  617. $response = array("response" => _x('Invalid Card Type (Billing Method). Please try again.', "s2member-front", "s2member"), "error" => true);
  618.  
  619. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_number"] || !is_string($s["card_number"])))
  620. $response = array("response" => _x('Missing Card Number. Please try again.', "s2member-front", "s2member"), "error" => true);
  621.  
  622. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_expiration"] || !is_string($s["card_expiration"])))
  623. $response = array("response" => _x('Missing Card Expiration Date (mm/yyyy). Please try again.', "s2member-front", "s2member"), "error" => true);
  624.  
  625. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && !preg_match("/^[0-9]{2}\/[0-9]{4}$/", $s["card_expiration"]))
  626. $response = array("response" => _x('Invalid Card Expiration Date. Must be in this format (mm/yyyy). Please try again.', "s2member-front", "s2member"), "error" => true);
  627.  
  628. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_verification"] || !is_string($s["card_verification"])))
  629. $response = array("response" => _x('Missing Card Verification Code. It\'s on the back of your Card. 3-4 digits. Please try again.', "s2member-front", "s2member"), "error" => true);
  630.  
  631. else if(in_array($s["card_type"], array("Maestro", "Solo")) && (!$s["card_start_date_issue_number"] || !is_string($s["card_start_date_issue_number"])))
  632. $response = array("response" => _x('Missing Card Start Date, or Issue #. Required for Maestro/Solo. Please try again.', "s2member-front", "s2member"), "error" => true);
  633. // -----------------------------------------------------------------------------------------------------------------
  634. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["street"] || !is_string($s["street"])))
  635. $response = array("response" => _x('Missing Street Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  636.  
  637. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["city"] || !is_string($s["city"])))
  638. $response = array("response" => _x('Missing City/Town. Please try again.', "s2member-front", "s2member"), "error" => true);
  639.  
  640. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["state"] || !is_string($s["state"])))
  641. $response = array("response" => _x('Missing State/Province. Please try again.', "s2member-front", "s2member"), "error" => true);
  642.  
  643. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["country"] || !is_string($s["country"])))
  644. $response = array("response" => _x('Missing Country. Please try again.', "s2member-front", "s2member"), "error" => true);
  645.  
  646. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["zip"] || !is_string($s["zip"])))
  647. $response = array("response" => _x('Missing Postal/Zip Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  648. // -----------------------------------------------------------------------------------------------------------------
  649. else if($s["attr"]["captcha"] && (!$s["recaptcha_challenge_field"] || !$s["recaptcha_response_field"] || !c_ws_plugin__s2member_utils_captchas::recaptcha_code_validates($s["recaptcha_challenge_field"], $s["recaptcha_response_field"])))
  650. $response = array("response" => _x('Missing or invalid Security Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  651. }
  652. else if /* Validation routines for free Registration forms. */($form === "registration")
  653. {
  654. if($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_names"] && (!$s["first_name"] || !is_string($s["first_name"])))
  655. $response = array("response" => _x('Missing First Name. Please try again.', "s2member-front", "s2member"), "error" => true);
  656.  
  657. else if($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_names"] && (!$s["last_name"] || !is_string($s["last_name"])))
  658. $response = array("response" => _x('Missing Last Name. Please try again.', "s2member-front", "s2member"), "error" => true);
  659.  
  660. else if(!$s["email"] || !is_string($s["email"]))
  661. $response = array("response" => _x('Missing or invalid Email Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  662.  
  663. else if(!is_email($s["email"]))
  664. $response = array("response" => _x('Invalid Email Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  665.  
  666. else if(email_exists($s["email"]) && (!is_multisite() || !c_ws_plugin__s2member_utils_users::ms_user_login_email_can_join_blog($s["username"], $s["email"])))
  667. $response = array("response" => _x('That Email Address is already in use. Please try again.', "s2member-front", "s2member"), "error" => true);
  668.  
  669. else if(!$s["username"] || !is_string($s["username"]))
  670. $response = array("response" => _x('Missing or invalid Username. Please try again.', "s2member-front", "s2member"), "error" => true);
  671.  
  672. else if(!validate_username($s["username"]) || !validate_username($s["_o_username"]))
  673. $response = array("response" => _x('Invalid Username. Please try again. Use ONLY lowercase alphanumerics.', "s2member-front", "s2member"), "error" => true);
  674.  
  675. else if(username_exists($s["username"]) && (!is_multisite() || !c_ws_plugin__s2member_utils_users::ms_user_login_email_can_join_blog($s["username"], $s["email"])))
  676. $response = array("response" => _x('That Username is already in use. Please try again.', "s2member-front", "s2member"), "error" => true);
  677.  
  678. else if(is_multisite() && !c_ws_plugin__s2member_utils_users::ms_user_login_email_can_join_blog($s["username"], $s["email"]) && ($_response = wpmu_validate_user_signup($s["username"], $s["email"])) && is_wp_error($_errors = $_response["errors"]) && $_errors->get_error_message())
  679. $response = array("response" => $_errors->get_error_message(), "error" => true);
  680.  
  681. else if((!$s["password1"] || !is_string($s["password1"])) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  682. $response = array("response" => _x('Missing Password. Please try again.', "s2member-front", "s2member"), "error" => true);
  683.  
  684. else if(strlen($s["password1"]) < 6 && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  685. $response = array("response" => _x('Invalid Password. Must be at least 6 characters. Please try again.', "s2member-front", "s2member"), "error" => true);
  686.  
  687. else if(strlen($s["password1"]) > 20 && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  688. $response = array("response" => _x('Invalid Password. Max length is 20 characters. Please try again.', "s2member-front", "s2member"), "error" => true);
  689.  
  690. else if($s["password2"] !== $s["password1"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  691. $response = array("response" => _x('Password fields do NOT match. Please try again.', "s2member-front", "s2member"), "error" => true);
  692. // -----------------------------------------------------------------------------------------------------------------
  693. else if($s["attr"]["captcha"] && (!$s["recaptcha_challenge_field"] || !$s["recaptcha_response_field"] || !c_ws_plugin__s2member_utils_captchas::recaptcha_code_validates($s["recaptcha_challenge_field"], $s["recaptcha_response_field"])))
  694. $response = array("response" => _x('Missing or invalid Security Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  695. }
  696. else if /* Validation routines for Specific Post/Page checkout forms. */($form === "sp-checkout")
  697. {
  698. if(!$s["first_name"] || !is_string($s["first_name"]))
  699. $response = array("response" => _x('Missing First Name. Please try again.', "s2member-front", "s2member"), "error" => true);
  700.  
  701. else if(!$s["last_name"] || !is_string($s["last_name"]))
  702. $response = array("response" => _x('Missing Last Name. Please try again.', "s2member-front", "s2member"), "error" => true);
  703.  
  704. else if(!$s["email"] || !is_string($s["email"]))
  705. $response = array("response" => _x('Missing or invalid Email Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  706.  
  707. else if(!is_email($s["email"]))
  708. $response = array("response" => _x('Invalid Email Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  709. // -----------------------------------------------------------------------------------------------------------------
  710. else if(!$s["card_type"] || !is_string($s["card_type"]))
  711. $response = array("response" => _x('Missing Card Type (Billing Method). Please try again.', "s2member-front", "s2member"), "error" => true);
  712.  
  713. else if(!in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo", "PayPal")) || !is_array($s["attr"]["accept"]) || !in_array(strtolower($s["card_type"]), $s["attr"]["accept"]))
  714. $response = array("response" => _x('Invalid Card Type (Billing Method). Please try again.', "s2member-front", "s2member"), "error" => true);
  715.  
  716. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_number"] || !is_string($s["card_number"])))
  717. $response = array("response" => _x('Missing Card Number. Please try again.', "s2member-front", "s2member"), "error" => true);
  718.  
  719. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_expiration"] || !is_string($s["card_expiration"])))
  720. $response = array("response" => _x('Missing Card Expiration Date (mm/yyyy). Please try again.', "s2member-front", "s2member"), "error" => true);
  721.  
  722. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && !preg_match("/^[0-9]{2}\/[0-9]{4}$/", $s["card_expiration"]))
  723. $response = array("response" => _x('Invalid Card Expiration Date. Must be in this format (mm/yyyy). Please try again.', "s2member-front", "s2member"), "error" => true);
  724.  
  725. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_verification"] || !is_string($s["card_verification"])))
  726. $response = array("response" => _x('Missing Card Verification Code. It\'s on the back of your Card. 3-4 digits. Please try again.', "s2member-front", "s2member"), "error" => true);
  727.  
  728. else if(in_array($s["card_type"], array("Maestro", "Solo")) && (!$s["card_start_date_issue_number"] || !is_string($s["card_start_date_issue_number"])))
  729. $response = array("response" => _x('Missing Card Start Date, or Issue #. Required for Maestro/Solo. Please try again.', "s2member-front", "s2member"), "error" => true);
  730. // -----------------------------------------------------------------------------------------------------------------
  731. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["street"] || !is_string($s["street"])))
  732. $response = array("response" => _x('Missing Street Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  733.  
  734. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["city"] || !is_string($s["city"])))
  735. $response = array("response" => _x('Missing City/Town. Please try again.', "s2member-front", "s2member"), "error" => true);
  736.  
  737. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["state"] || !is_string($s["state"])))
  738. $response = array("response" => _x('Missing State/Province. Please try again.', "s2member-front", "s2member"), "error" => true);
  739.  
  740. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["country"] || !is_string($s["country"])))
  741. $response = array("response" => _x('Missing Country. Please try again.', "s2member-front", "s2member"), "error" => true);
  742.  
  743. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["zip"] || !is_string($s["zip"])))
  744. $response = array("response" => _x('Missing Postal/Zip Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  745. // -----------------------------------------------------------------------------------------------------------------
  746. else if($s["attr"]["captcha"] && (!$s["recaptcha_challenge_field"] || !$s["recaptcha_response_field"] || !c_ws_plugin__s2member_utils_captchas::recaptcha_code_validates($s["recaptcha_challenge_field"], $s["recaptcha_response_field"])))
  747. $response = array("response" => _x('Missing or invalid Security Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  748. }
  749. else if /* Validation routines for Member Level checkout forms. This is the default functionality. */($form === "checkout")
  750. {
  751. if($s["attr"]["modify"] && !is_user_logged_in())
  752. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">log in</a> to modify your billing plan.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  753. // -----------------------------------------------------------------------------------------------------------------
  754. else if($s["attr"]["level"] === "*" && !is_user_logged_in())
  755. $response = array("response" => sprintf(_x('You must <a href="%s" rel="nofollow">log in</a> before making this purchase.', "s2member-front", "s2member"), esc_attr(wp_login_url($_SERVER["REQUEST_URI"]))), "error" => true);
  756. // -----------------------------------------------------------------------------------------------------------------
  757. else if(is_user_logged_in() && is_object($user = wp_get_current_user()) && $user->ID && $user->has_cap("administrator")) // NOT for Administrators.
  758. $response = array("response" => _x('Unable to process. You are an Administrator. Stopping here for security. Otherwise, an Administrator could lose access.', "s2member-admin", "s2member"), "error" => true);
  759. // -----------------------------------------------------------------------------------------------------------------
  760. else if(!$s["first_name"] || !is_string($s["first_name"]))
  761. $response = array("response" => _x('Missing First Name. Please try again.', "s2member-front", "s2member"), "error" => true);
  762.  
  763. else if(!$s["last_name"] || !is_string($s["last_name"]))
  764. $response = array("response" => _x('Missing Last Name. Please try again.', "s2member-front", "s2member"), "error" => true);
  765.  
  766. else if(!is_user_logged_in() && (!$s["email"] || !is_string($s["email"])))
  767. $response = array("response" => _x('Missing or invalid Email Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  768.  
  769. else if(!is_user_logged_in() && !is_email($s["email"]))
  770. $response = array("response" => _x('Invalid Email Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  771.  
  772. else if(!is_user_logged_in() && email_exists($s["email"]) && (!is_multisite() || !c_ws_plugin__s2member_utils_users::ms_user_login_email_can_join_blog($s["username"], $s["email"])))
  773. $response = array("response" => _x('That Email Address is already in use. Please try again.', "s2member-front", "s2member"), "error" => true);
  774.  
  775. else if(!is_user_logged_in() && (!$s["username"] || !is_string($s["username"])))
  776. $response = array("response" => _x('Missing or invalid Username. Please try again.', "s2member-front", "s2member"), "error" => true);
  777.  
  778. else if(!is_user_logged_in() && (!validate_username($s["username"]) || !validate_username($s["_o_username"])))
  779. $response = array("response" => _x('Invalid Username. Please try again. Use ONLY lowercase alphanumerics.', "s2member-front", "s2member"), "error" => true);
  780.  
  781. else if(!is_user_logged_in() && username_exists($s["username"]) && (!is_multisite() || !c_ws_plugin__s2member_utils_users::ms_user_login_email_can_join_blog($s["username"], $s["email"])))
  782. $response = array("response" => _x('That Username is already in use. Please try again.', "s2member-front", "s2member"), "error" => true);
  783.  
  784. else if(!is_user_logged_in() && is_multisite() && !c_ws_plugin__s2member_utils_users::ms_user_login_email_can_join_blog($s["username"], $s["email"]) && ($_response = wpmu_validate_user_signup($s["username"], $s["email"])) && is_wp_error($_errors = $_response["errors"]) && $_errors->get_error_message())
  785. $response = array("response" => $_errors->get_error_message(), "error" => true);
  786.  
  787. else if(!is_user_logged_in() && (!$s["password1"] || !is_string($s["password1"])) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  788. $response = array("response" => _x('Missing Password. Please try again.', "s2member-front", "s2member"), "error" => true);
  789.  
  790. else if(!is_user_logged_in() && strlen($s["password1"]) < 6 && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  791. $response = array("response" => _x('Invalid Password. Must be at least 6 characters. Please try again.', "s2member-front", "s2member"), "error" => true);
  792.  
  793. else if(!is_user_logged_in() && strlen($s["password1"]) > 20 && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  794. $response = array("response" => _x('Invalid Password. Max length is 20 characters. Please try again.', "s2member-front", "s2member"), "error" => true);
  795.  
  796. else if(!is_user_logged_in() && $s["password2"] !== $s["password1"] && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
  797. $response = array("response" => _x('Password fields do NOT match. Please try again.', "s2member-front", "s2member"), "error" => true);
  798. // -----------------------------------------------------------------------------------------------------------------
  799. else if(!$s["card_type"] || !is_string($s["card_type"]))
  800. $response = array("response" => _x('Missing Card Type (Billing Method). Please try again.', "s2member-front", "s2member"), "error" => true);
  801.  
  802. else if(!in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo", "PayPal")) || !is_array($s["attr"]["accept"]) || !in_array(strtolower($s["card_type"]), $s["attr"]["accept"]))
  803. $response = array("response" => _x('Invalid Card Type (Billing Method). Please try again.', "s2member-front", "s2member"), "error" => true);
  804.  
  805. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_number"] || !is_string($s["card_number"])))
  806. $response = array("response" => _x('Missing Card Number. Please try again.', "s2member-front", "s2member"), "error" => true);
  807.  
  808. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_expiration"] || !is_string($s["card_expiration"])))
  809. $response = array("response" => _x('Missing Card Expiration Date (mm/yyyy). Please try again.', "s2member-front", "s2member"), "error" => true);
  810.  
  811. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && !preg_match("/^[0-9]{2}\/[0-9]{4}$/", $s["card_expiration"]))
  812. $response = array("response" => _x('Invalid Card Expiration Date. Must be in this format (mm/yyyy). Please try again.', "s2member-front", "s2member"), "error" => true);
  813.  
  814. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["card_verification"] || !is_string($s["card_verification"])))
  815. $response = array("response" => _x('Missing Card Verification Code. It\'s on the back of your Card. 3-4 digits. Please try again.', "s2member-front", "s2member"), "error" => true);
  816.  
  817. else if(in_array($s["card_type"], array("Maestro", "Solo")) && (!$s["card_start_date_issue_number"] || !is_string($s["card_start_date_issue_number"])))
  818. $response = array("response" => _x('Missing Card Start Date, or Issue #. Required for Maestro/Solo. Please try again.', "s2member-front", "s2member"), "error" => true);
  819. // -----------------------------------------------------------------------------------------------------------------
  820. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["street"] || !is_string($s["street"])))
  821. $response = array("response" => _x('Missing Street Address. Please try again.', "s2member-front", "s2member"), "error" => true);
  822.  
  823. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["city"] || !is_string($s["city"])))
  824. $response = array("response" => _x('Missing City/Town. Please try again.', "s2member-front", "s2member"), "error" => true);
  825.  
  826. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["state"] || !is_string($s["state"])))
  827. $response = array("response" => _x('Missing State/Province. Please try again.', "s2member-front", "s2member"), "error" => true);
  828.  
  829. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["country"] || !is_string($s["country"])))
  830. $response = array("response" => _x('Missing Country. Please try again.', "s2member-front", "s2member"), "error" => true);
  831.  
  832. else if(in_array($s["card_type"], array("Visa", "MasterCard", "Discover", "Amex", "Maestro", "Solo")) && (!$s["zip"] || !is_string($s["zip"])))
  833. $response = array("response" => _x('Missing Postal/Zip Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  834. // -----------------------------------------------------------------------------------------------------------------
  835. else if($s["attr"]["captcha"] && (!$s["recaptcha_challenge_field"] || !$s["recaptcha_response_field"] || !c_ws_plugin__s2member_utils_captchas::recaptcha_code_validates($s["recaptcha_challenge_field"], $s["recaptcha_response_field"])))
  836. $response = array("response" => _x('Missing or invalid Security Code. Please try again.', "s2member-front", "s2member"), "error" => true);
  837. }
  838. else // Else we are dealing with an unknown form submission type.
  839. $response = array("response" => _x('Unknown form submission type. Please contact Support.', "s2member-front", "s2member"), "error" => true);
  840. }
  841. return apply_filters("ws_plugin__s2member_pro_paypal_form_submission_validation_response", ((empty($response)) ? null : $response), $form, $s);
  842. }
  843. }
  844. }
  845. ?>

pro\s2member-pro\includes\classes\gateways\paypal\paypal-responses.inc.php

Source Code Documentation