本文整理汇总了PHP中c_ws_plugin__s2member_paypal_utilities::paypal_pro_term方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_paypal_utilities::paypal_pro_term方法的具体用法?PHP c_ws_plugin__s2member_paypal_utilities::paypal_pro_term怎么用?PHP c_ws_plugin__s2member_paypal_utilities::paypal_pro_term使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_paypal_utilities
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_paypal_utilities::paypal_pro_term方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paypal_checkout
//.........这里部分代码省略.........
/* Otherwise, we assume they provided an Issue Number instead. */
$_paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
}
}
/**/
$_paypal["STREET"] = $post_vars["street"];
$_paypal["CITY"] = $post_vars["city"];
$_paypal["STATE"] = $post_vars["state"];
$_paypal["COUNTRYCODE"] = $post_vars["country"];
$_paypal["ZIP"] = $post_vars["zip"];
}
}
/**/
if (!($paypal = array())) {
$paypal["METHOD"] = "CreateRecurringPaymentsProfile";
/**/
$paypal["EMAIL"] = $user->user_email;
$paypal["FIRSTNAME"] = $post_vars["first_name"];
$paypal["LASTNAME"] = $post_vars["last_name"];
$paypal["SUBSCRIBERNAME"] = $post_vars["name"];
/**/
$paypal["DESC"] = $cost_calculations["desc"];
$paypal["PROFILEREFERENCE"] = $reference;
/**/
$paypal["CURRENCYCODE"] = $cost_calculations["cur"];
$paypal["AMT"] = $cost_calculations["sub_total"];
$paypal["TAXAMT"] = $cost_calculations["tax"];
/**/
$paypal["MAXFAILEDPAYMENTS"] = $post_vars["attr"]["rra"];
$paypal["AUTOBILLOUTAMT"] = apply_filters("ws_plugin__s2member_pro_paypal_auto_bill_op", "AddToNextBilling", get_defined_vars());
/**/
$paypal["PROFILESTARTDATE"] = date("Y-m-d", $start_time) . "T00:00:00Z";
/**/
$paypal["BILLINGPERIOD"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_term($post_vars["attr"]["rt"]);
$paypal["TOTALBILLINGCYCLES"] = $post_vars["attr"]["rr"] ? $post_vars["attr"]["rrt"] ? $post_vars["attr"]["rrt"] : "0" : "1";
$paypal["BILLINGFREQUENCY"] = $post_vars["attr"]["rp"];
/**/
if ($_GET["s2member_paypal_xco"] === "s2member_pro_paypal_checkout_return" && !empty($_GET["token"]) && (!empty($_paypal_xco_details) && empty($_paypal_xco_details["__error"]) && ($paypal_xco_details = $_paypal_xco_details) || ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"]))) {
$paypal["TOKEN"] = $paypal_xco_details["TOKEN"];
} else {
$paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
$paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
$paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
$paypal["CVV2"] = $post_vars["card_verification"];
/**/
if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
$paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
} else {
/* Otherwise, we assume they provided an Issue Number instead. */
$paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
}
}
/**/
$paypal["STREET"] = $post_vars["street"];
$paypal["CITY"] = $post_vars["city"];
$paypal["STATE"] = $post_vars["state"];
$paypal["COUNTRYCODE"] = $post_vars["country"];
$paypal["ZIP"] = $post_vars["zip"];
}
}
/**/
if (!$_paypal || ($_paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($_paypal)) && empty($_paypal["__error"])) {
if (($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
$new__txn_id = $_paypal && !empty($_paypal["PAYMENTINFO_0_TRANSACTIONID"]) ? $_paypal["PAYMENTINFO_0_TRANSACTIONID"] : false;
$new__txn_id = !$new__txn_id && $_paypal && !empty($_paypal["TRANSACTIONID"]) ? $_paypal["TRANSACTIONID"] : $new__txn_id;
示例2: paypal_checkout
//.........这里部分代码省略.........
set_transient("s2m_" . md5("s2member_transient_express_checkout_" . $paypal_set_xco["TOKEN"]), $_POST, 10800);
$endpoint = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com";
wp_redirect(add_query_arg("token", urlencode($paypal_set_xco["TOKEN"]), "https://" . $endpoint . "/cgi-bin/webscr?cmd=_express-checkout"));
exit;
} else {
$global_response = array("response" => $paypal_set_xco["__error"], "error" => true);
}
} else {
if ($use_recurring_profile && is_user_logged_in() && is_object($user = wp_get_current_user()) && ($user_id = $user->ID)) {
if (!($cur__subscr_id = get_user_option("s2member_subscr_id")) || !($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response(array("METHOD" => "GetRecurringPaymentsProfileDetails", "PROFILEID" => $cur__subscr_id))) || !empty($paypal["__error"]) || !preg_match("/^(Pending|PendingProfile)\$/i", $paypal["STATUS"])) {
$period1 = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1($post_vars["attr"]["tp"] . " " . $post_vars["attr"]["tt"]);
$period3 = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3($post_vars["attr"]["rp"] . " " . $post_vars["attr"]["rt"]);
$start_time = $post_vars["attr"]["tp"] ? c_ws_plugin__s2member_pro_paypal_utilities::paypal_start_time($period1) : c_ws_plugin__s2member_pro_paypal_utilities::paypal_start_time($period3);
$reference = $start_time . ":" . $period1 . ":" . $period3 . "~" . $_SERVER["HTTP_HOST"] . "~" . $post_vars["attr"]["level_ccaps_eotper"];
update_user_meta($user_id, "first_name", $post_vars["first_name"]) . update_user_meta($user_id, "last_name", $post_vars["last_name"]);
if (!($paypal = array())) {
$paypal["METHOD"] = "CreateRecurringPaymentsProfile";
$paypal["EMAIL"] = $user->user_email;
$paypal["FIRSTNAME"] = $post_vars["first_name"];
$paypal["LASTNAME"] = $post_vars["last_name"];
$paypal["SUBSCRIBERNAME"] = $post_vars["name"];
$paypal["DESC"] = $cost_calculations["desc"];
$paypal["PROFILEREFERENCE"] = $reference;
if (!$post_vars["attr"]["tp"] || $post_vars["attr"]["tp"] && $cost_calculations["trial_total"] > 0) {
$paypal["INITAMT"] = $post_vars["attr"]["tp"] ? $cost_calculations["trial_total"] : $cost_calculations["total"];
$paypal["FAILEDINITAMTACTION"] = "CancelOnFailure";
}
$paypal["CURRENCYCODE"] = $cost_calculations["cur"];
$paypal["AMT"] = $cost_calculations["sub_total"];
$paypal["TAXAMT"] = $cost_calculations["tax"];
$paypal["MAXFAILEDPAYMENTS"] = $post_vars["attr"]["rra"];
$paypal["AUTOBILLOUTAMT"] = apply_filters("ws_plugin__s2member_pro_paypal_auto_bill_op", "AddToNextBilling", get_defined_vars());
$paypal["PROFILESTARTDATE"] = date("Y-m-d", $start_time) . "T00:00:00Z";
$paypal["BILLINGPERIOD"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_term($post_vars["attr"]["rt"]);
$paypal["TOTALBILLINGCYCLES"] = $post_vars["attr"]["rr"] ? $post_vars["attr"]["rrt"] ? $post_vars["attr"]["rrt"] : "0" : "1";
$paypal["BILLINGFREQUENCY"] = $post_vars["attr"]["rp"];
if (!empty($_GET["s2member_paypal_xco"]) && $_GET["s2member_paypal_xco"] === "s2member_pro_paypal_checkout_return" && !empty($_GET["token"]) && ($paypal_xco_details = array("METHOD" => "GetExpressCheckoutDetails", "TOKEN" => $_GET["token"])) && ($paypal_xco_details = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal_xco_details)) && empty($paypal_xco_details["__error"])) {
$paypal["TOKEN"] = $paypal_xco_details["TOKEN"];
} else {
$paypal["CREDITCARDTYPE"] = $post_vars["card_type"];
$paypal["ACCT"] = preg_replace("/[^0-9]/", "", $post_vars["card_number"]);
$paypal["EXPDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_expiration"]);
$paypal["CVV2"] = $post_vars["card_verification"];
if (in_array($post_vars["card_type"], array("Maestro", "Solo"))) {
if (preg_match("/^[0-9]{2}\\/[0-9]{4}\$/", $post_vars["card_start_date_issue_number"])) {
$paypal["STARTDATE"] = preg_replace("/[^0-9]/", "", $post_vars["card_start_date_issue_number"]);
} else {
// Otherwise, we assume they provided an Issue Number.
$paypal["ISSUENUMBER"] = $post_vars["card_start_date_issue_number"];
}
}
$paypal["STREET"] = $post_vars["street"];
$paypal["CITY"] = $post_vars["city"];
$paypal["STATE"] = $post_vars["state"];
$paypal["COUNTRYCODE"] = $post_vars["country"];
$paypal["ZIP"] = $post_vars["zip"];
}
}
if ($cost_calculations["trial_total"] <= 0 && $cost_calculations["total"] <= 0 || ($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal)) && empty($paypal["__error"])) {
$old__subscr_or_wp_id = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id();
$old__subscr_id = get_user_option("s2member_subscr_id");
if ($cost_calculations["trial_total"] <= 0 && $cost_calculations["total"] <= 0) {
$new__subscr_id = strtoupper('free-' . uniqid());
} else {
$new__subscr_id = $paypal["PROFILEID"];
}