当前位置: 首页>>代码示例>>PHP>>正文


PHP MemberOrder::getTax方法代码示例

本文整理汇总了PHP中MemberOrder::getTax方法的典型用法代码示例。如果您正苦于以下问题:PHP MemberOrder::getTax方法的具体用法?PHP MemberOrder::getTax怎么用?PHP MemberOrder::getTax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemberOrder的用法示例。


在下文中一共展示了MemberOrder::getTax方法的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;
     }
 }
开发者ID:javierdlahoz,项目名称:dcbia-wp,代码行数:85,代码来源:class.pmprogateway_paypalexpress.php

示例2: trim

     $morder->billing->name = $bfirstname . " " . $blastname;
     $morder->billing->street = trim($baddress1 . " " . $baddress2);
     $morder->billing->city = $bcity;
     $morder->billing->state = $bstate;
     $morder->billing->country = $bcountry;
     $morder->billing->zip = $bzipcode;
     $morder->billing->phone = $bphone;
     //$gateway = pmpro_getOption("gateway");
     $morder->gateway = $gateway;
     $morder->setGateway();
     //setup level var
     $morder->getMembershipLevel();
     $morder->membership_level = apply_filters("pmpro_checkout_level", $morder->membership_level);
     //tax
     $morder->subtotal = $morder->InitialPayment;
     $morder->getTax();
     //filter for order, since v2.0
     $morder = apply_filters("pmpro_checkout_order", $morder);
     $pmpro_processed = $morder->process();
     if (!empty($pmpro_processed)) {
         $pmpro_msg = __("Payment accepted.", "pmpro");
         $pmpro_msgt = "pmpro_success";
         $pmpro_confirmed = true;
     } else {
         $pmpro_msg = $morder->error;
         if (empty($pmpro_msg)) {
             $pmpro_msg = __("Unknown error generating account. Please contact us to set up your membership.", "pmpro");
         }
         $pmpro_msgt = "pmpro_error";
     }
 } else {
开发者ID:AmpleTech,项目名称:paid-memberships-pro,代码行数:31,代码来源:checkout.php


注:本文中的MemberOrder::getTax方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。