本文整理汇总了PHP中c_ws_plugin__s2member_paypal_utilities::paypal_std_term方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_paypal_utilities::paypal_std_term方法的具体用法?PHP c_ws_plugin__s2member_paypal_utilities::paypal_std_term怎么用?PHP c_ws_plugin__s2member_paypal_utilities::paypal_std_term使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_paypal_utilities
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_paypal_utilities::paypal_std_term方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paypal_pro_period3
/**
* Get `period3` from either an array with `PROFILEREFERENCE|rp_invoice_id|period3`, or use an existing string.
*
* This will also convert `1 Day`, into `1 D`, and so on.
* This will also convert `1 SemiMonth`, into `2 W`, and so on.
* The Regular Period can never be less than 1 day ( `1 D` ).
*
* @package s2Member\PayPal
* @since 3.5
*
* @param string|array $array_or_string Either an array of PayPal post vars, or a string.
* If it's a string, we make sure it is a valid `period term` combination.
* @param string $default Optional. Value if unavailable. Defaults to `1 D`.
* @return string A `period3` string if possible, or defaults to `1 D`.
*/
public static function paypal_pro_period3($array_or_string = FALSE, $default = "1 D")
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_paypal_pro_period3", get_defined_vars());
unset($__refs, $__v);
if (is_array($array_or_string) && isset($array_or_string["PROFILENAME"])) {
$array_or_string["PROFILEREFERENCE"] = $array_or_string["PROFILENAME"];
}
if (is_array($array = $array_or_string) && !empty($array["period3"])) {
$_period3 = trim($array["period3"]);
} else {
if (is_array($array = $array_or_string) && (!empty($array["PROFILEREFERENCE"]) || !empty($array["rp_invoice_id"]))) {
list($_reference, $_domain, $_item_number) = array_map("trim", preg_split("/~/", !empty($array["PROFILEREFERENCE"]) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"], 3));
list($_start_time, $_period1, $_period3) = array_map("trim", preg_split("/\\:/", $_reference, 3));
} else {
if (is_array($array = $array_or_string) && !empty($array["mp_id"]) && ($ipn_signup_var_period3 = c_ws_plugin__s2member_utils_users::get_user_ipn_signup_var("period3", FALSE, $array["mp_id"]))) {
$_period3 = trim($ipn_signup_var_period3);
} else {
if (is_string($string = $array_or_string) && !empty($string)) {
$_period3 = trim($string);
}
}
}
}
if (!empty($_period3)) {
list($num, $span) = array_map("trim", preg_split("/ /", $_period3, 2));
if (strtoupper($span) === "SEMIMONTH" && is_numeric($num) && $num >= 1) {
$num = "2";
$span = "W";
}
if (strlen($span) !== 1) {
$span = c_ws_plugin__s2member_paypal_utilities::paypal_std_term($span);
}
$span = preg_match("/^[DWMY]\$/i", $span) ? $span : "";
$num = $span && is_numeric($num) && $num >= 0 ? $num : "";
$period3 = $num && $span ? $num . " " . strtoupper($span) : $default;
return apply_filters("ws_plugin__s2member_paypal_pro_period3", $period3, get_defined_vars());
} else {
return apply_filters("ws_plugin__s2member_paypal_pro_period3", $default, get_defined_vars());
}
}
示例2: paypal_pro_period3
/**
* Get `period3` from either an array with `PROFILEREFERENCE|rp_invoice_id|period3`, or use an existing string.
*
* This will also convert `1 Day`, into `1 D`, and so on.
* This will also convert `1 SemiMonth`, into `2 W`, and so on.
* The Regular Period can never be less than 1 day ( `1 D` ).
*
* @package s2Member\PayPal
* @since 3.5
*
* @param str|array $array_or_string Either an array of PayPal® post vars, or a string.
* If it's a string, we make sure it is a valid `period term` combination.
* @param str $default Optional. Value if unavailable. Defaults to `1 D`.
* @return str A `period3` string if possible, or defaults to `1 D`.
*/
public static function paypal_pro_period3($array_or_string = FALSE, $default = "1 D")
{
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_before_paypal_pro_period3", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
if (is_array($array = $array_or_string) && (!empty($array["PROFILEREFERENCE"]) || !empty($array["rp_invoice_id"]))) {
list($_reference, $_domain, $_item_number) = array_map("trim", preg_split("/~/", !empty($array["PROFILEREFERENCE"]) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"], 3));
list($_start_time, $_period1, $_period3) = array_map("trim", preg_split("/\\:/", $_reference, 3));
} else {
if (is_array($array = $array_or_string) && !empty($array["period3"])) {
$_period3 = trim($array["period3"]);
} else {
if (is_string($string = $array_or_string) && !empty($string)) {
$_period3 = trim($string);
}
}
}
/**/
if (!empty($_period3)) {
list($num, $span) = array_map("trim", preg_split("/ /", $_period3, 2));
/**/
if (strtoupper($span) === "SEMIMONTH") {
if (is_numeric($num) && $num >= 1) {
eval('$num = "2"; $span = "W";');
}
}
/**/
if (strlen($span) !== 1) {
/* To Standard format. */
$span = c_ws_plugin__s2member_paypal_utilities::paypal_std_term($span);
}
/**/
$span = preg_match("/^[DWMY]\$/i", $span) ? $span : "";
$num = $span && is_numeric($num) && $num >= 0 ? $num : "";
/**/
$period3 = $num && $span ? $num . " " . strtoupper($span) : $default;
/**/
return apply_filters("ws_plugin__s2member_paypal_pro_period3", $period3, get_defined_vars());
} else {
/* Default. */
return apply_filters("ws_plugin__s2member_paypal_pro_period3", $default, get_defined_vars());
}
}