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


PHP PMProEmail::sendCheckoutEmail方法代码示例

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


在下文中一共展示了PMProEmail::sendCheckoutEmail方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pmprosl_pmpro_default_registration_level

function pmprosl_pmpro_default_registration_level($user_id)
{
    global $pmpro_level;
    //if default is set and we're not otherwise checking out
    $default_level = get_option('pmpro_social_login_default_level');
    if (!empty($default_level) && empty($pmpro_level) && empty($_REQUEST['level'])) {
        pmpro_changeMembershipLevel($default_level, $user_id);
        $user = get_userdata($user_id);
        $user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
        //send email to member
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutEmail($user, false);
        //send email to admin
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutAdminEmail($user, false);
    }
}
开发者ID:messica,项目名称:pmpro-social-login,代码行数:17,代码来源:pmpro-social-login.php

示例2: pmpro_insRecurringRestarted

function pmpro_insRecurringRestarted($morder)
{
    global $pmpro_error;
    //hook to do other stuff when payments restart
    do_action("pmpro_subscription_recuring_restarted", $last_order);
    $worked = pmpro_changeMembershipLevel($morder->membership_level->id, $morder->user->ID);
    if ($worked === true) {
        //$pmpro_msg = __("Your membership has been cancelled.", 'pmpro');
        //$pmpro_msgt = "pmpro_success";
        //send an email to the member
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutEmail($morder->user, $morder);
        //send email to admin
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutAdminEmail($morder->user, $morder);
        inslog("Subscription restarted due to 'recurring restarted' INS notification.");
        return true;
    } else {
        return false;
    }
}
开发者ID:Seravo,项目名称:wp-paid-subscriptions,代码行数:21,代码来源:twocheckout-ins.php

示例3: MemberOrder

     //show the confirmation
     $ordersaved = true;
     //hook
     do_action("pmpro_after_checkout", $user_id, $morder);
     //added $morder param in v2.0
     //setup some values for the emails
     if (!empty($morder)) {
         $invoice = new MemberOrder($morder->id);
     } else {
         $invoice = NULL;
     }
     $current_user->membership_level = $pmpro_level;
     //make sure they have the right level info
     //send email to member
     $pmproemail = new PMProEmail();
     $pmproemail->sendCheckoutEmail($current_user, $invoice);
     //send email to admin
     $pmproemail = new PMProEmail();
     $pmproemail->sendCheckoutAdminEmail($current_user, $invoice);
     //redirect to confirmation
     $rurl = pmpro_url("confirmation", "?level=" . $pmpro_level->id);
     $rurl = apply_filters("pmpro_confirmation_url", $rurl, $user_id, $pmpro_level);
     wp_redirect($rurl);
     exit;
 } else {
     //uh oh. we charged them then the membership creation failed
     if (isset($morder) && $morder->cancel()) {
         $pmpro_msg = __("IMPORTANT: Something went wrong during membership creation. Your credit card authorized, but we cancelled the order immediately. You should not try to submit this form again. Please contact the site owner to fix this issue.", "pmpro");
         $morder = NULL;
     } else {
         $pmpro_msg = __("IMPORTANT: Something went wrong during membership creation. Your credit card was charged, but we couldn't assign your membership. You should not submit this form again. Please contact the site owner to fix this issue.", "pmpro");
开发者ID:AmpleTech,项目名称:paid-memberships-pro,代码行数:31,代码来源:checkout.php

示例4: pmpro_ipnChangeMembershipLevel

function pmpro_ipnChangeMembershipLevel($txn_id, &$morder)
{
    //filter for level
    $morder->membership_level = apply_filters("pmpro_ipnhandler_level", $morder->membership_level, $morder->user_id);
    //fix expiration date
    if (!empty($morder->membership_level->expiration_number)) {
        $enddate = "'" . date("Y-m-d", strtotime("+ " . $morder->membership_level->expiration_number . " " . $morder->membership_level->expiration_period, current_time("timestamp"))) . "'";
    } else {
        $enddate = "NULL";
    }
    //get discount code
    $morder->getDiscountCode();
    if (!empty($morder->discount_code)) {
        //update membership level
        $morder->getMembershipLevel(true);
        $discount_code_id = $morder->discount_code->id;
    } else {
        $discount_code_id = "";
    }
    //set the start date to current_time('timestamp') but allow filters
    $startdate = apply_filters("pmpro_checkout_start_date", "'" . current_time('mysql') . "'", $morder->user_id, $morder->membership_level);
    //custom level to change user to
    $custom_level = array('user_id' => $morder->user_id, 'membership_id' => $morder->membership_level->id, 'code_id' => $discount_code_id, 'initial_payment' => $morder->membership_level->initial_payment, 'billing_amount' => $morder->membership_level->billing_amount, 'cycle_number' => $morder->membership_level->cycle_number, 'cycle_period' => $morder->membership_level->cycle_period, 'billing_limit' => $morder->membership_level->billing_limit, 'trial_amount' => $morder->membership_level->trial_amount, 'trial_limit' => $morder->membership_level->trial_limit, 'startdate' => $startdate, 'enddate' => $enddate);
    global $pmpro_error;
    if (!empty($pmpro_error)) {
        echo $pmpro_error;
        ipnlog($pmpro_error);
    }
    //change level and continue "checkout"
    if (pmpro_changeMembershipLevel($custom_level, $morder->user_id) !== false) {
        //update order status and transaction ids
        $morder->status = "success";
        $morder->payment_transaction_id = $txn_id;
        if (!empty($_POST['subscr_id'])) {
            $morder->subscription_transaction_id = $_POST['subscr_id'];
        } else {
            $morder->subscription_transaction_id = "";
        }
        $morder->saveOrder();
        //add discount code use
        if (!empty($discount_code) && !empty($use_discount_code)) {
            $wpdb->query("INSERT INTO {$wpdb->pmpro_discount_codes_uses} (code_id, user_id, order_id, timestamp) VALUES('" . $discount_code_id . "', '" . $morder->user_id . "', '" . $morder->id . "', '" . current_time('mysql') . "");
        }
        //save first and last name fields
        if (!empty($_POST['first_name'])) {
            $old_firstname = get_user_meta($morder->user_id, "first_name", true);
            if (empty($old_firstname)) {
                update_user_meta($morder->user_id, "first_name", $_POST['first_name']);
            }
        }
        if (!empty($_POST['last_name'])) {
            $old_lastname = get_user_meta($morder->user_id, "last_name", true);
            if (empty($old_lastname)) {
                update_user_meta($morder->user_id, "last_name", $_POST['last_name']);
            }
        }
        //hook
        do_action("pmpro_after_checkout", $morder->user_id);
        //setup some values for the emails
        if (!empty($morder)) {
            $invoice = new MemberOrder($morder->id);
        } else {
            $invoice = NULL;
        }
        $user = get_userdata($morder->user_id);
        $user->membership_level = $morder->membership_level;
        //make sure they have the right level info
        //send email to member
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutEmail($user, $invoice);
        //send email to admin
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutAdminEmail($user, $invoice);
        return true;
    } else {
        return false;
    }
}
开发者ID:srinivasulurao,项目名称:transcharity,代码行数:78,代码来源:ipnhandler.php

示例5: date

	function pmpro_ipnChangeMembershipLevel($txn_id, &$morder)
	{
		//filter for level
		$morder->membership_level = apply_filters("pmpro_ipnhandler_level", $morder->membership_level, $morder->user_id);
					
		//fix expiration date		
		if(!empty($morder->membership_level->expiration_number))
		{
			$enddate = "'" . date("Y-m-d", strtotime("+ " . $morder->membership_level->expiration_number . " " . $morder->membership_level->expiration_period)) . "'";
		}
		else
		{
			$enddate = "NULL";
		}
		
		//get discount code		(NOTE: but discount_code isn't set here. How to handle discount codes for PayPal Standard?)
		$use_discount_code = true;		//assume yes
		if(!empty($discount_code) && !empty($use_discount_code))
			$discount_code_id = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_discount_codes WHERE code = '" . $discount_code . "' LIMIT 1");
		else
			$discount_code_id = "";
		
		//set the start date to NOW() but allow filters
		$startdate = apply_filters("pmpro_checkout_start_date", "NOW()", $morder->user_id, $morder->membership_level);
		
		//custom level to change user to
		$custom_level = array(
			'user_id' => $morder->user_id,
			'membership_id' => $morder->membership_level->id,
			'code_id' => $discount_code_id,
			'initial_payment' => $morder->membership_level->initial_payment,
			'billing_amount' => $morder->membership_level->billing_amount,
			'cycle_number' => $morder->membership_level->cycle_number,
			'cycle_period' => $morder->membership_level->cycle_period,
			'billing_limit' => $morder->membership_level->billing_limit,
			'trial_amount' => $morder->membership_level->trial_amount,
			'trial_limit' => $morder->membership_level->trial_limit,
			'startdate' => $startdate,
			'enddate' => $enddate);

		global $pmpro_error;
		if(!empty($pmpro_error))
		{
			echo $pmpro_error;
			ipnlog($pmpro_error);				
		}
		
		if(pmpro_changeMembershipLevel($custom_level, $morder->user_id) !== false)
		{
			//update order status and transaction ids					
			$morder->status = "success";
			$morder->payment_transaction_id = $txn_id;
			if(!empty($_POST['subscr_id']))
				$morder->subscription_transaction_id = $_POST['subscr_id'];
			else
				$morder->subscription_transaction_id = "";
			$morder->saveOrder();
			
			//add discount code use
			if(!empty($discount_code) && !empty($use_discount_code))
			{
				$wpdb->query("INSERT INTO $wpdb->pmpro_discount_codes_uses (code_id, user_id, order_id, timestamp) VALUES('" . $discount_code_id . "', '" . $current_user->ID . "', '" . $morder->id . "', now())");					
			}									
		
			//save first and last name fields
			if(!empty($_POST['first_name']))
			{
				$old_firstname = get_user_meta($morder->user_id, "first_name", true);
				if(!empty($old_firstname))
					update_user_meta($morder->user_id, "first_name", $_POST['first_name']);
			}
			if(!empty($_POST['last_name']))
			{
				$old_lastname = get_user_meta($morder->user_id, "last_name", true);
				if(!empty($old_lastname))
					update_user_meta($morder->user_id, "last_name", $_POST['last_name']);
			}
												
			//hook
			do_action("pmpro_after_checkout", $morder->user_id);						
		
			//setup some values for the emails
			if(!empty($morder))
				$invoice = new MemberOrder($morder->id);						
			else
				$invoice = NULL;
		
			$user = get_userdata($morder->user_id);
			$user->membership_level = $morder->membership_level;		//make sure they have the right level info
		
			//send email to member
			$pmproemail = new PMProEmail();				
			$pmproemail->sendCheckoutEmail($user, $invoice);
										
			//send email to admin
			$pmproemail = new PMProEmail();
			$pmproemail->sendCheckoutAdminEmail($user, $invoice);
			
			return true;
		}
//.........这里部分代码省略.........
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:101,代码来源:ipnhandler.php

示例6: pmpro_insChangeMembershipLevel

function pmpro_insChangeMembershipLevel($txn_id, &$morder)
{
    $recurring = pmpro_getParam('rectoken', 'POST');
    //filter for level
    $morder->membership_level = apply_filters("pmpro_inshandler_level", $morder->membership_level, $morder->user_id);
    //set the start date to current_time('mysql') but allow filters (documented in preheaders/checkout.php)
    $startdate = apply_filters("pmpro_checkout_start_date", "'" . current_time('mysql') . "'", $morder->user_id, $morder->membership_level);
    //fix expiration date
    if (!empty($morder->membership_level->expiration_number)) {
        $enddate = "'" . date("Y-m-d", strtotime("+ " . $morder->membership_level->expiration_number . " " . $morder->membership_level->expiration_period, current_time("timestamp"))) . "'";
    } else {
        $enddate = "NULL";
    }
    //filter the enddate (documented in preheaders/checkout.php)
    $enddate = apply_filters("pmpro_checkout_end_date", $enddate, $morder->user_id, $morder->membership_level, $startdate);
    //get discount code
    $morder->getDiscountCode();
    if (!empty($morder->discount_code)) {
        //update membership level
        $morder->getMembershipLevel(true);
        $discount_code_id = $morder->discount_code->id;
    } else {
        $discount_code_id = "";
    }
    //custom level to change user to
    $custom_level = array('user_id' => $morder->user_id, 'membership_id' => $morder->membership_level->id, 'code_id' => $discount_code_id, 'initial_payment' => $morder->membership_level->initial_payment, 'billing_amount' => $morder->membership_level->billing_amount, 'cycle_number' => $morder->membership_level->cycle_number, 'cycle_period' => $morder->membership_level->cycle_period, 'billing_limit' => $morder->membership_level->billing_limit, 'trial_amount' => $morder->membership_level->trial_amount, 'trial_limit' => $morder->membership_level->trial_limit, 'startdate' => $startdate, 'enddate' => $enddate);
    global $pmpro_error;
    if (!empty($pmpro_error)) {
        //echo $pmpro_error;
        fnlog($pmpro_error);
    }
    if (pmpro_changeMembershipLevel($custom_level, $morder->user_id) !== false) {
        //update order status and transaction ids
        $morder->status = "success";
        $morder->payment_transaction_id = $txn_id;
        if (!$recurring) {
            $morder->subscription_transaction_id = $txn_id;
        } else {
            $morder->subscription_transaction_id = '';
        }
        $morder->saveOrder();
        //add discount code use
        if (!empty($discount_code) && !empty($use_discount_code)) {
            $wpdb->query("INSERT INTO {$wpdb->pmpro_discount_codes_uses} (code_id, user_id, order_id, timestamp) VALUES('" . $discount_code_id . "', '" . $morder->user_id . "', '" . $morder->id . "', '" . current_time('mysql') . "')");
        }
        //hook
        do_action("pmpro_after_checkout", $morder->user_id);
        //print_r ($morder); die;
        //setup some values for the emails
        if (!empty($morder)) {
            $invoice = new MemberOrder($morder->id);
        } else {
            $invoice = NULL;
        }
        fnlog("CHANGEMEMBERSHIPLEVEL: ORDER: " . var_export($morder, true) . "\n---\n");
        $user = get_userdata($morder->user_id);
        if (empty($user)) {
            return false;
        }
        $user->membership_level = $morder->membership_level;
        //make sure they have the right level info
        //send email to member
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutEmail($user, $invoice);
        //send email to admin
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutAdminEmail($user, $invoice);
        return true;
    } else {
        return false;
    }
}
开发者ID:cloudipsp,项目名称:wordpress,代码行数:72,代码来源:fondy-ins.php

示例7: pmpro_insSaveOrder

function pmpro_insSaveOrder($txnref, $last_order)
{
    global $wpdb;
    //check that txn_id has not been previously processed
    $old_txn = $wpdb->get_var("SELECT payment_transaction_id FROM {$wpdb->pmpro_membership_orders} WHERE payment_transaction_id = '" . $txnref . "' LIMIT 1");
    if (empty($old_txn)) {
        //hook for successful subscription payments
        do_action("pmpro_subscription_payment_completed");
        //save order
        $morder = new MemberOrder();
        $morder->user_id = $last_order->user_id;
        $morder->membership_id = $last_order->membership_id;
        $morder->payment_transaction_id = $txnref;
        $morder->subscription_transaction_id = $last_order->subscription_transaction_id;
        $morder->InitialPayment = $last_order->InitialPayment;
        //$_POST['item_list_amount_1'];	//not the initial payment, but the class is expecting that
        $morder->PaymentAmount = $last_order->PaymentAmount;
        //$_POST['item_list_amount_1'];
        $morder->gateway = $last_order->gateway;
        $morder->gateway_environment = $last_order->gateway_environment;
        //save
        $morder->saveOrder();
        $pmproemail = new PMProEmail();
        $pmproemail->sendInvoiceEmail($user_id, $morder);
        $user = get_userdata($morder->user_id);
        $user->membership_level = $morder->membership_level;
        //make sure they have the right level info
        //send email to member
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutEmail($user_id, $morder);
        //send email to admin
        $pmproemail = new PMProEmail();
        $pmproemail->sendCheckoutAdminEmail($user_id, $morder);
        $morder->getMemberOrderByID($morder->id);
        // //email the user their invoice
        $pmproemail = new PMProEmail();
        $pmproemail->sendInvoiceEmail(get_userdata($last_order->user_id), $morder);
        if (strpos(PMPRO_INS_DEBUG, "@")) {
            $log_email = PMPRO_INS_DEBUG;
        } else {
            $log_email = get_option("admin_email");
        }
        inslog("New order (" . $morder->code . ") created.");
        return true;
    } else {
        inslog("Duplicate Transaction ID: " . $txnref);
        return false;
    }
}
开发者ID:Madu-rosh,项目名称:MIGS-for-paid-membership-pro,代码行数:49,代码来源:paymenthandler.php


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