本文整理汇总了PHP中MemberOrder::getMemberOrderByPayPalToken方法的典型用法代码示例。如果您正苦于以下问题:PHP MemberOrder::getMemberOrderByPayPalToken方法的具体用法?PHP MemberOrder::getMemberOrderByPayPalToken怎么用?PHP MemberOrder::getMemberOrderByPayPalToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberOrder
的用法示例。
在下文中一共展示了MemberOrder::getMemberOrderByPayPalToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MemberOrder
/**
* Review and Confirmation code.
*
* @since 1.8
*/
static function pmpro_checkout_confirmed($pmpro_confirmed)
{
global $pmpro_msg, $pmpro_msgt, $pmpro_level, $current_user, $pmpro_review, $pmpro_paypal_token, $discount_code, $bemail;
//PayPal Express Call Backs
if (!empty($_REQUEST['review'])) {
if (!empty($_REQUEST['PayerID'])) {
$_SESSION['payer_id'] = $_REQUEST['PayerID'];
}
if (!empty($_REQUEST['paymentAmount'])) {
$_SESSION['paymentAmount'] = $_REQUEST['paymentAmount'];
}
if (!empty($_REQUEST['currencyCodeType'])) {
$_SESSION['currCodeType'] = $_REQUEST['currencyCodeType'];
}
if (!empty($_REQUEST['paymentType'])) {
$_SESSION['paymentType'] = $_REQUEST['paymentType'];
}
$morder = new MemberOrder();
$morder->getMemberOrderByPayPalToken($_REQUEST['token']);
$morder->Token = $morder->paypal_token;
$pmpro_paypal_token = $morder->paypal_token;
if ($morder->Token) {
if ($morder->Gateway->getExpressCheckoutDetails($morder)) {
$pmpro_review = true;
} else {
$pmpro_msg = $morder->error;
$pmpro_msgt = "pmpro_error";
}
} else {
$pmpro_msg = __("The PayPal Token was lost.", "pmpro");
$pmpro_msgt = "pmpro_error";
}
} elseif (!empty($_REQUEST['confirm'])) {
$morder = new MemberOrder();
$morder->getMemberOrderByPayPalToken($_REQUEST['token']);
$morder->Token = $morder->paypal_token;
$pmpro_paypal_token = $morder->paypal_token;
if ($morder->Token) {
//set up values
$morder->membership_id = $pmpro_level->id;
$morder->membership_name = $pmpro_level->name;
$morder->discount_code = $discount_code;
$morder->InitialPayment = $pmpro_level->initial_payment;
$morder->PaymentAmount = $pmpro_level->billing_amount;
$morder->ProfileStartDate = date("Y-m-d") . "T0:0:0";
$morder->BillingPeriod = $pmpro_level->cycle_period;
$morder->BillingFrequency = $pmpro_level->cycle_number;
$morder->Email = $bemail;
//set up level var
$morder->getMembershipLevel();
$morder->membership_level = apply_filters("pmpro_checkout_level", $morder->membership_level);
//tax
$morder->subtotal = $morder->InitialPayment;
$morder->getTax();
if ($pmpro_level->billing_limit) {
$morder->TotalBillingCycles = $pmpro_level->billing_limit;
}
if (pmpro_isLevelTrial($pmpro_level)) {
$morder->TrialBillingPeriod = $pmpro_level->cycle_period;
$morder->TrialBillingFrequency = $pmpro_level->cycle_number;
$morder->TrialBillingCycles = $pmpro_level->trial_limit;
$morder->TrialAmount = $pmpro_level->trial_amount;
}
if ($morder->confirm()) {
$pmpro_confirmed = true;
} else {
$pmpro_msg = $morder->error;
$pmpro_msgt = "pmpro_error";
}
} else {
$pmpro_msg = __("The PayPal Token was lost.", "pmpro");
$pmpro_msgt = "pmpro_error";
}
}
if (!empty($morder)) {
return array("pmpro_confirmed" => $pmpro_confirmed, "morder" => $morder);
} else {
return $pmpro_confirmed;
}
}
示例2: elseif
$morder->Token = $morder->paypal_token;
$pmpro_paypal_token = $morder->paypal_token;
if ($morder->Token) {
if ($morder->Gateway->getExpressCheckoutDetails($morder)) {
$pmpro_review = true;
} else {
$pmpro_msg = $morder->error;
$pmpro_msgt = "pmpro_error";
}
} else {
$pmpro_msg = __("The PayPal Token was lost.", "pmpro");
$pmpro_msgt = "pmpro_error";
}
} elseif (!empty($_REQUEST['confirm'])) {
$morder = new MemberOrder();
$morder->getMemberOrderByPayPalToken($_REQUEST['token']);
$morder->Token = $morder->paypal_token;
$pmpro_paypal_token = $morder->paypal_token;
if ($morder->Token) {
//setup values
$morder->membership_id = $pmpro_level->id;
$morder->membership_name = $pmpro_level->name;
$morder->discount_code = $discount_code;
$morder->InitialPayment = $pmpro_level->initial_payment;
$morder->PaymentAmount = $pmpro_level->billing_amount;
$morder->ProfileStartDate = date("Y-m-d") . "T0:0:0";
$morder->BillingPeriod = $pmpro_level->cycle_period;
$morder->BillingFrequency = $pmpro_level->cycle_number;
$morder->Email = $bemail;
//$gateway = pmpro_getOption("gateway");
//setup level var