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


PHP edd_get_payment_meta_user_info函数代码示例

本文整理汇总了PHP中edd_get_payment_meta_user_info函数的典型用法代码示例。如果您正苦于以下问题:PHP edd_get_payment_meta_user_info函数的具体用法?PHP edd_get_payment_meta_user_info怎么用?PHP edd_get_payment_meta_user_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_data

 /**
  * Get the data being exported
  *
  * @access      public
  * @since       1.2
  * @return      array
  */
 public function get_data()
 {
     global $edd_logs;
     $data = array();
     $args = array('nopaging' => true, 'post_type' => 'edd_payment', 'meta_key' => '_edd_payment_shipping_status', 'meta_value' => '1', 'fields' => 'ids');
     $payments = get_posts($args);
     if ($payments) {
         foreach ($payments as $payment) {
             $user_info = edd_get_payment_meta_user_info($payment);
             $downloads = edd_get_payment_meta_cart_details($payment);
             $products = '';
             if ($downloads) {
                 foreach ($downloads as $key => $download) {
                     // Display the Downoad Name
                     $products .= get_the_title($download['id']);
                     if ($key != count($downloads) - 1) {
                         $products .= ' / ';
                     }
                 }
             }
             $data[] = array('id' => $payment, 'date' => get_post_field('post_date', $payment), 'first_name' => $user_info['first_name'], 'last_name' => $user_info['last_name'], 'email' => $user_info['email'], 'address' => $user_info['shipping_info']['address'], 'address2' => !empty($user_info['shipping_info']['address2']) ? $user_info['shipping_info']['address2'] : '', 'city' => $user_info['shipping_info']['city'], 'state' => $user_info['shipping_info']['state'], 'zip' => $user_info['shipping_info']['zip'], 'country' => $user_info['shipping_info']['country'], 'amount' => edd_get_payment_amount($payment), 'tax' => edd_get_payment_tax($payment), 'gateway' => edd_get_payment_gateway($payment), 'key' => edd_get_payment_key($payment), 'products' => $products, 'status' => get_post_field('post_status', $payment));
         }
     }
     $data = apply_filters('edd_export_get_data', $data);
     $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
     return $data;
 }
开发者ID:JiveDig,项目名称:EDD-Simple-Shipping,代码行数:34,代码来源:class-shipping-export.php

示例2: sumobi_edd_customer_details_username

function sumobi_edd_customer_details_username($payment_id)
{
    $user_info = edd_get_payment_meta_user_info($payment_id);
    $customer_id = $user_info['id'];
    if (!$customer_id) {
        return;
    }
    $user_data = get_userdata($customer_id);
    $user_name = $user_data->user_login;
    ?>
	<div class="column-container" style="margin-top: 20px;">
		<div class="column">
			<strong><?php 
    _e('Username:', 'edd');
    ?>
</strong><br />
			<a href="<?php 
    echo get_edit_user_link($customer_id);
    ?>
"><?php 
    echo $user_name;
    ?>
</a>
		</div>
	</div>
	<?php 
}
开发者ID:mintplugins,项目名称:library,代码行数:27,代码来源:add-username-to-customer-details.php

示例3: filter_reminder_template_tags

 public function filter_reminder_template_tags($text = '', $license_id = 0)
 {
     $payment_id = get_post_meta($license_id, '_edd_sl_payment_id', true);
     $user_info = edd_get_payment_meta_user_info($payment_id);
     $user_id = edd_get_payment_user_id($payment_id);
     // Retrieve the customer name
     if ($user_id) {
         $user_data = get_userdata($user_id);
         $customer_name = $user_data->display_name;
     } elseif (isset($user_info['first_name'])) {
         $customer_name = $user_info['first_name'];
     } else {
         $customer_name = $user_info['email'];
     }
     $license_key = edd_software_licensing()->get_license_key($license_id);
     $download_id = get_post_meta($license_id, '_edd_sl_download_id', true);
     $product_name = get_the_title($download_id);
     $expiration = edd_software_licensing()->get_license_expiration($license_id);
     $expiration = date(get_option('date_format'), $expiration);
     $discount = edd_sl_get_renewal_discount_percentage($license_id);
     $renewal_link = apply_filters('edd_sl_renewal_link', edd_get_checkout_uri(array('edd_license_key' => $license_key, 'download_id' => $download_id)));
     $text = str_replace('{name}', $customer_name, $text);
     $text = str_replace('{license_key}', $license_key, $text);
     $text = str_replace('{product_name}', $product_name, $text);
     $text = str_replace('{expiration}', $expiration, $text);
     if (!empty($discount)) {
         $text = str_replace('{renewal_discount}', $discount . '%', $text);
     }
     $text = str_replace('{renewal_link}', $renewal_link, $text);
     return $text;
 }
开发者ID:SelaInc,项目名称:eassignment,代码行数:31,代码来源:EDD_SL_Emails.php

示例4: get_data

 /**
  * Get the Export Data
  *
  * @access public
  * @since 1.4.4
  * @global object $wpdb Used to query the database using the WordPress
  *   Database API
  * @return array $data The data for the CSV file
  */
 public function get_data()
 {
     global $wpdb, $edd_options;
     $data = array();
     $payments = edd_get_payments(array('offset' => 0, 'number' => -1, 'mode' => edd_is_test_mode() ? 'test' : 'live', 'status' => isset($_POST['edd_export_payment_status']) ? $_POST['edd_export_payment_status'] : 'any', 'month' => isset($_POST['month']) ? absint($_POST['month']) : date('n'), 'year' => isset($_POST['year']) ? absint($_POST['year']) : date('Y')));
     foreach ($payments as $payment) {
         $payment_meta = edd_get_payment_meta($payment->ID);
         $user_info = edd_get_payment_meta_user_info($payment->ID);
         $downloads = edd_get_payment_meta_cart_details($payment->ID);
         $total = isset($payment_meta['amount']) ? $payment_meta['amount'] : 0.0;
         $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
         $products = '';
         $skus = '';
         if ($downloads) {
             foreach ($downloads as $key => $download) {
                 // Download ID
                 $id = isset($payment_meta['cart_details']) ? $download['id'] : $download;
                 // If the download has variable prices, override the default price
                 $price_override = isset($payment_meta['cart_details']) ? $download['price'] : null;
                 $price = edd_get_download_final_price($id, $user_info, $price_override);
                 // Display the Downoad Name
                 $products .= get_the_title($id) . ' - ';
                 if (edd_use_skus()) {
                     $sku = edd_get_download_sku($id);
                     if (!empty($sku)) {
                         $skus .= $sku;
                     }
                 }
                 if (isset($downloads[$key]['item_number']) && isset($downloads[$key]['item_number']['options'])) {
                     $price_options = $downloads[$key]['item_number']['options'];
                     if (isset($price_options['price_id'])) {
                         $products .= edd_get_price_option_name($id, $price_options['price_id']) . ' - ';
                     }
                 }
                 $products .= html_entity_decode(edd_currency_filter($price));
                 if ($key != count($downloads) - 1) {
                     $products .= ' / ';
                     if (edd_use_skus()) {
                         $skus .= ' / ';
                     }
                 }
             }
         }
         if (is_numeric($user_id)) {
             $user = get_userdata($user_id);
         } else {
             $user = false;
         }
         $data[] = array('id' => $payment->ID, 'email' => $payment_meta['email'], 'first' => $user_info['first_name'], 'last' => $user_info['last_name'], 'products' => $products, 'skus' => $skus, 'amount' => html_entity_decode(edd_format_amount($total)), 'tax' => html_entity_decode(edd_get_payment_tax($payment->ID, $payment_meta)), 'discount' => isset($user_info['discount']) && $user_info['discount'] != 'none' ? $user_info['discount'] : __('none', 'edd'), 'gateway' => edd_get_gateway_admin_label(get_post_meta($payment->ID, '_edd_payment_gateway', true)), 'key' => $payment_meta['key'], 'date' => $payment->post_date, 'user' => $user ? $user->display_name : __('guest', 'edd'), 'status' => edd_get_payment_status($payment, true));
         if (!edd_use_skus()) {
             unset($data['skus']);
         }
     }
     $data = apply_filters('edd_export_get_data', $data);
     $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
     return $data;
 }
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:66,代码来源:class-export-payments.php

示例5: get_content_html

 /**
  * Retrieve the full HTML for the tickets email
  *
  * @param int $payment_id
  *
  * @return string
  */
 public function get_content_html($payment_id = 0)
 {
     $user_info = edd_get_payment_meta_user_info($payment_id);
     $args = array('post_type' => Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_object, 'meta_key' => Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_order_key, 'meta_value' => $payment_id, 'posts_per_page' => -1, 'fields' => 'ids');
     $query = new WP_Query($args);
     $attendees = array();
     foreach ($query->posts as $ticket_id) {
         $attendees[] = array('event_id' => get_post_meta($ticket_id, Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_event_key, true), 'ticket_name' => get_post(get_post_meta($ticket_id, Tribe__Tickets_Plus__Commerce__EDD__Main::$attendee_product_key, true))->post_title, 'holder_name' => $user_info['first_name'] . ' ' . $user_info['last_name'], 'order_id' => $payment_id, 'ticket_id' => $ticket_id, 'security_code' => get_post_meta($ticket_id, Tribe__Tickets_Plus__Commerce__EDD__Main::$security_code, true));
     }
     return Tribe__Tickets_Plus__Commerce__EDD__Main::get_instance()->generate_tickets_email_content($attendees);
 }
开发者ID:jamestrevorlees,项目名称:odd-web-v1.00,代码行数:18,代码来源:Email.php

示例6: edd_points_add_point_for_complete_purchase

 /**
  * Add points for purchase
  * 
  * Handles to add points for purchases
  *
  * @package Easy Digital Downloads - Points and Rewards
  * @since 1.0.0
  */
 public function edd_points_add_point_for_complete_purchase($payment_id)
 {
     global $edd_options, $current_user;
     //get payment data
     $paymentdata = edd_get_payment_meta($payment_id);
     $userdata = edd_get_payment_meta_user_info($payment_id);
     $user_id = isset($userdata['id']) && !empty($userdata['id']) ? $userdata['id'] : 0;
     //get discount towards points
     $gotdiscount = $this->model->edd_points_get_payment_discount($payment_id);
     //check user has redeemed points or not & user_id should not empty
     if (isset($gotdiscount) && !empty($gotdiscount) && !empty($user_id)) {
         //get discounte price from points
         $discountedpoints = $this->model->edd_points_calculate_points($gotdiscount);
         //update user points
         edd_points_minus_points_from_user($discountedpoints, $user_id);
         //points label
         $pointslable = $this->model->edd_points_get_points_label($discountedpoints);
         //record data logs for redeem for purchase
         $post_data = array('post_title' => sprintf(__('Redeem %s for purchase', 'eddpoints'), $pointslable), 'post_content' => sprintf(__('%s redeemed for purchasing download by redeeming the points and get discounts.', 'eddpoints'), $pointslable), 'post_author' => $user_id);
         //log meta array
         $log_meta = array('userpoint' => $discountedpoints, 'events' => 'redeemed_purchase', 'operation' => 'minus');
         //insert entry in log
         $this->logs->edd_points_insert_logs($post_data, $log_meta);
         // set order meta, regardless of whether any points were earned, just so we know the process took place
         update_post_meta($payment_id, '_edd_points_order_redeemed', $discountedpoints);
     }
     //end if to check points redeemed taken by buyer or not
     // get cartdata from older order
     $cartdata = edd_get_payment_meta_cart_details($payment_id);
     //get bought points for points downloads types
     $boughtpoints = $this->model->edd_points_get_bought_points($cartdata);
     //get cart points from cartdata and payment discount given to user
     $cartpoints = $this->model->edd_points_get_user_checkout_points($cartdata, $gotdiscount);
     //add bought points to cart points
     $cartpoints = !empty($boughtpoints) ? $cartpoints + $boughtpoints : $cartpoints;
     //check checkout points earned points or user id is not empty
     if (!empty($cartpoints) && !empty($user_id)) {
         //points label
         $pointslable = $this->model->edd_points_get_points_label($cartpoints);
         //get user points after subtracting the redemption points
         $userpoints = edd_points_get_user_points();
         $post_data = array('post_title' => sprintf(__('%s earned for purchasing the downloads.', 'eddpoints'), $pointslable), 'post_content' => sprintf(__('Get %s for purchasing the downloads.', 'eddpoints'), $pointslable), 'post_author' => $user_id);
         $log_meta = array('userpoint' => $cartpoints, 'events' => 'earned_purchase', 'operation' => 'add');
         //insert entry in log
         $this->logs->edd_points_insert_logs($post_data, $log_meta);
         //update user points
         edd_points_add_points_to_user($cartpoints, $user_id);
         // set order meta, regardless of whether any points were earned, just so we know the process took place
         update_post_meta($payment_id, '_edd_points_order_earned', $cartpoints);
     }
     //end if to check checkout points should not empty
 }
开发者ID:nguyenthai2010,项目名称:ngocshop,代码行数:60,代码来源:class-edd-points-public.php

示例7: get_data

 /**
  * Get the data being exported
  *
  * @return array $data
  */
 public function get_data()
 {
     global $wpdb;
     $data = array();
     $campaign = $this->campaign;
     $campaign = atcf_get_campaign($campaign);
     $backers = $campaign->backers();
     if (empty($backers)) {
         return $data;
     }
     foreach ($backers as $log) {
         $payment_id = get_post_meta($log->ID, '_edd_log_payment_id', true);
         $payment = get_post($payment_id);
         $payment_meta = edd_get_payment_meta($payment_id);
         $user_info = edd_get_payment_meta_user_info($payment_id);
         $downloads = edd_get_payment_meta_cart_details($payment_id);
         $total = edd_get_payment_amount($payment_id);
         $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
         $products = '';
         if ($downloads) {
             foreach ($downloads as $key => $download) {
                 // Download ID
                 $id = isset($payment_meta['cart_details']) ? $download['id'] : $download;
                 // If the download has variable prices, override the default price
                 $price_override = isset($payment_meta['cart_details']) ? $download['price'] : null;
                 $price = edd_get_download_final_price($id, $user_info, $price_override);
                 // Display the Downoad Name
                 $products .= get_the_title($id) . ' - ';
                 if (isset($downloads[$key]['item_number'])) {
                     $price_options = $downloads[$key]['item_number']['options'];
                     if (isset($price_options['price_id'])) {
                         $products .= edd_get_price_option_name($id, $price_options['price_id']) . ' - ';
                     }
                 }
                 $products .= html_entity_decode(edd_currency_filter($price));
                 if ($key != count($downloads) - 1) {
                     $products .= ' / ';
                 }
             }
         }
         if (is_numeric($user_id)) {
             $user = get_userdata($user_id);
         } else {
             $user = false;
         }
         $shipping = isset($payment_meta['shipping']) ? $payment_meta['shipping'] : null;
         $data[] = apply_filters('atcf_csv_cols_values', array('id' => $payment_id, 'email' => $payment_meta['email'], 'first' => $user_info['first_name'], 'last' => $user_info['last_name'], 'shipping' => isset($shipping) ? implode("\n", $shipping) : '', 'products' => $products, 'amount' => html_entity_decode(edd_currency_filter(edd_format_amount($total))), 'tax' => html_entity_decode(edd_payment_tax($payment_id, $payment_meta)), 'discount' => isset($user_info['discount']) && $user_info['discount'] != 'none' ? $user_info['discount'] : __('none', 'atcf'), 'gateway' => edd_get_gateway_admin_label(get_post_meta($payment_id, '_edd_payment_gateway', true)), 'key' => $payment_meta['key'], 'date' => date_i18n(get_option('date_format'), strtotime($payment->post_date)), 'user' => $user ? $user->display_name : __('guest', 'atcf'), 'status' => edd_get_payment_status($payment, true)), $payment_id);
     }
     $data = apply_filters('edd_export_get_data', $data);
     $data = apply_filters('edd_export_get_data_' . $this->export_type, $data);
     return $data;
 }
开发者ID:WilliamJamesDalrympleWest,项目名称:crowdfunding,代码行数:57,代码来源:class-export-campaigns.php

示例8: track_discount_referral

 /**
  * Records referrals for the affiliate if a discount code belonging to the affiliate is used
  *
  * @access  public
  * @since   1.1
  */
 public function track_discount_referral($payment_id = 0)
 {
     $user_info = edd_get_payment_meta_user_info($payment_id);
     if (isset($user_info['discount']) && $user_info['discount'] != 'none') {
         if (affiliate_wp()->settings->get('edd_disable_on_renewals')) {
             $was_renewal = get_post_meta($payment_id, '_edd_sl_is_renewal', true);
             if ($was_renewal) {
                 return;
             }
         }
         $discounts = array_map('trim', explode(',', $user_info['discount']));
         if (empty($discounts)) {
             return;
         }
         foreach ($discounts as $code) {
             $discount_id = edd_get_discount_id_by_code($code);
             $affiliate_id = get_post_meta($discount_id, 'affwp_discount_affiliate', true);
             if (!$affiliate_id) {
                 continue;
             }
             $this->affiliate_id = $affiliate_id;
             if (!affiliate_wp()->tracking->is_valid_affiliate($this->affiliate_id)) {
                 continue;
             }
             $existing = affiliate_wp()->referrals->get_by('reference', $payment_id, $this->context);
             // calculate the referral total
             $referral_total = $this->get_referral_total($payment_id, $this->affiliate_id);
             // referral already exists, update it
             if (!empty($existing->referral_id)) {
                 // If a referral was already recorded, overwrite it with the linked discount affiliate
                 affiliate_wp()->referrals->update($existing->referral_id, array('affiliate_id' => $this->affiliate_id, 'status' => 'unpaid', 'amount' => $referral_total), '', 'referral');
             } else {
                 // new referral
                 if (0 == $referral_total && affiliate_wp()->settings->get('ignore_zero_referrals')) {
                     return false;
                     // Ignore a zero amount referral
                 }
                 $desc = $this->get_referral_description($payment_id);
                 if (empty($desc)) {
                     return false;
                 }
                 $referral_id = affiliate_wp()->referrals->add(array('amount' => $referral_total, 'reference' => $payment_id, 'description' => $desc, 'affiliate_id' => $this->affiliate_id, 'context' => $this->context, 'products' => $this->get_products($payment_id)));
             }
         }
     }
 }
开发者ID:jwondrusch,项目名称:AffiliateWP,代码行数:52,代码来源:class-edd.php

示例9: edd_customerio_connect_register_user

/**
 * Track new users
 *
 * @since       1.0.0
 * @param       int $payment_id The ID of a given payment
 * @return      void
 */
function edd_customerio_connect_register_user($payment_id)
{
    // Bail if API isn't setup
    if (!edd_customerio_connect()->api) {
        return;
    }
    // Setup the request body
    $user_info = edd_get_payment_meta_user_info($payment_id);
    $payment_meta = edd_get_payment_meta($payment_id);
    $cart_items = isset($payment_meta['cart_details']) ? maybe_unserialize($payment_meta['cart_details']) : false;
    $user_name = false;
    if ($payment_meta['user_info']['first_name']) {
        $user_name = $payment_meta['user_info']['first_name'];
        if ($payment_meta['user_info']['last_name']) {
            $user_name .= ' ' . $payment_meta['user_info']['last_name'];
        }
    }
    $body = array('email' => $payment_meta['user_info']['email'], 'created_at' => $payment_meta['date']);
    if ($user_name) {
        $body['name'] = $user_name;
    }
    $response = edd_customerio_connect()->api->call($payment_meta['user_info']['id'], $body);
    // Track the purchases
    if (empty($cart_items) || !$cart_items) {
        $cart_items = maybe_unserialize($payment_meta['downloads']);
    }
    if ($cart_items) {
        $body = array('name' => 'purchased', 'data' => array('discount' => $payment_meta['user_info']['discount']));
        foreach ($cart_items as $key => $cart_item) {
            $item_id = isset($payment_meta['cart_details']) ? $cart_item['id'] : $cart_item;
            $price = $cart_item['price'];
            $body['data']['items'][$cart_item['id']] = array('price' => $price, 'product_id' => $cart_item['id'], 'product_name' => esc_attr($cart_item['name']));
            if (edd_has_variable_prices($cart_item['id'])) {
                $body['data']['items'][$cart_item['id']]['price_id'] = $cart_item['item_number']['options']['price_id'];
                $body['data']['items'][$cart_item['id']]['price_name'] = edd_get_price_option_name($cart_item['id'], $cart_item['item_number']['options']['price_id']);
                $body['data']['items'][$cart_item['id']]['quantity'] = $cart_item['item_number']['quantity'];
            } else {
                $body['data']['items'][$cart_item['id']]['quantity'] = $cart_item['quantity'];
            }
            if (edd_use_taxes()) {
                $body['data']['items'][$cart_item['id']]['tax'] = $cart_item['tax'];
            }
        }
        $response = edd_customerio_connect()->api->call($payment_meta['user_info']['id'], $body, 'POST', 'events');
    }
}
开发者ID:easydigitaldownloads,项目名称:EDD-Customerio-Connect,代码行数:53,代码来源:actions.php

示例10: activate_license

 /**
  * After license activation, if is trial -- add to a list
  *
  * @used "edd_activate_license"
  */
 public static function activate_license($data)
 {
     $license = !empty($data['license']) ? urldecode($data['license']) : false;
     $license_id = \EDD_Software_Licensing::instance()->get_license_by_key($license);
     $payment_id = get_post_meta($license_id, '_edd_sl_payment_id', true);
     $user_info = edd_get_payment_meta_user_info($payment_id);
     self::save_license_meta($data, $license_id, $user_info, $payment_id);
     $item_id = !empty($data['item_id']) ? absint($data['item_id']) : false;
     if (1 == 3 && class_exists('EDD_ConvertKit') && isset($data['details']['vertical']) && (self::$trial || ingSL::$trial == $item_id)) {
         self::$trial = true;
         $vertical = $data['details']['vertical'];
         if (!in_array($vertical, ingSL_verticals())) {
             return;
         }
         //$url        = isset( $data[ 'url' ] ) ? urldecode( $data[ 'url' ] ) : '';
         $convert_kit = new \EDD_ConvertKit();
         $convert_kit->subscribe_email($user_info, $vertical, true);
     }
 }
开发者ID:Ingothq,项目名称:ingSL,代码行数:24,代码来源:IngSL.php

示例11: subscribe_from_edd

 /**
  * @param int $payment_id The ID of the payment
  *
  * @return bool|string
  */
 public function subscribe_from_edd($payment_id)
 {
     if (!$this->triggered($payment_id)) {
         return false;
     }
     $email = (string) edd_get_payment_user_email($payment_id);
     $merge_vars = array();
     // add first and last name to merge vars, if given
     $user_info = (array) edd_get_payment_meta_user_info($payment_id);
     if (isset($user_info['first_name']) && isset($user_info['last_name'])) {
         $merge_vars['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
     }
     if (isset($user_info['first_name'])) {
         $merge_vars['FNAME'] = $user_info['first_name'];
     }
     if (isset($user_info['last_name'])) {
         $merge_vars['LNAME'] = $user_info['last_name'];
     }
     return $this->subscribe($email, $merge_vars, $payment_id);
 }
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:25,代码来源:class-easy-digital-downloads.php

示例12: subscribe_from_edd

 /**
  * @param int $payment_id The ID of the payment
  *
  * @return bool|string
  */
 public function subscribe_from_edd($payment_id)
 {
     if (!$this->triggered($payment_id)) {
         return false;
     }
     $email = (string) edd_get_payment_user_email($payment_id);
     $data = array('EMAIL' => $email);
     // add first and last name to merge vars, if given
     $user_info = (array) edd_get_payment_meta_user_info($payment_id);
     if (!empty($user_info['first_name']) && !empty($user_info['last_name'])) {
         $data['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
     }
     if (!empty($user_info['first_name'])) {
         $data['FNAME'] = $user_info['first_name'];
     }
     if (!empty($user_info['last_name'])) {
         $data['LNAME'] = $user_info['last_name'];
     }
     return $this->subscribe($data, $payment_id);
 }
开发者ID:dannyvankooten,项目名称:mailchimp-for-wordpress,代码行数:25,代码来源:class-easy-digital-downloads.php

示例13: subscribe_from_edd_purchase

 /**
  * @param int $payment_id The ID of the payment
  *
  * @return bool|string
  */
 public function subscribe_from_edd_purchase($payment_id)
 {
     $meta = get_post_meta($payment_id, '_yikes_easy_mc_optin', true);
     if ($meta == '0') {
         return false;
     }
     $email = (string) edd_get_payment_user_email($payment_id);
     $merge_vars = array();
     // add first and last name to merge vars, if given
     $user_info = (array) edd_get_payment_meta_user_info($payment_id);
     if (isset($user_info['first_name']) && isset($user_info['last_name'])) {
         $merge_vars['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
     }
     if (isset($user_info['first_name'])) {
         $merge_vars['FNAME'] = $user_info['first_name'];
     }
     if (isset($user_info['last_name'])) {
         $merge_vars['LNAME'] = $user_info['last_name'];
     }
     // subscribe the user
     $this->subscribe_user_integration(sanitize_email($email), $this->type, $merge_vars);
 }
开发者ID:misfist,项目名称:missdrepants-network,代码行数:27,代码来源:class.easy_digital_downloads_checkout_form-checkbox.php

示例14: edd_receipt_shortcode

/**
 * Receipt Shortcode
 *
 * Shows an order receipt.
 *
 * @since 1.4
 * @param array $atts Shortcode attributes
 * @param string $content
 * @return string
 */
function edd_receipt_shortcode($atts, $content = null)
{
    global $edd_receipt_args;
    $edd_receipt_args = shortcode_atts(array('error' => __('Sorry, trouble retrieving payment receipt.', 'edd'), 'price' => true, 'discount' => true, 'products' => true, 'date' => true, 'notes' => true, 'payment_key' => true, 'payment_method' => true, 'payment_id' => true), $atts);
    $session = edd_get_purchase_session();
    if (isset($_GET['purchase_key'])) {
        $purchase_key = urldecode($_GET['purchase_key']);
    } else {
        if ($session) {
            $purchase_key = $session['purchase_key'];
        }
    }
    // No key found
    if (!isset($purchase_key)) {
        return $edd_receipt_args['error'];
    }
    $edd_receipt_args['id'] = edd_get_purchase_id_by_key($purchase_key);
    $user = edd_get_payment_meta_user_info($edd_receipt_args['id']);
    // Not the proper user
    if (is_user_logged_in() && $user['id'] != get_current_user_id()) {
        return $edd_receipt_args['error'];
    }
    ob_start();
    edd_get_template_part('shortcode', 'receipt');
    $display = ob_get_clean();
    return $display;
}
开发者ID:bangtienmanh,项目名称:Easy-Digital-Downloads,代码行数:37,代码来源:shortcodes.php

示例15: edd_clear_user_history_cache

/**
 * Flushes the current user's purchase history transient when a payment status
 * is updated
 *
 * @since 1.2.2
 *
 * @param $payment_id
 * @param $new_status the status of the payment, probably "publish"
 * @param $old_status the status of the payment prior to being marked as "complete", probably "pending"
 */
function edd_clear_user_history_cache($payment_id, $new_status, $old_status)
{
    $user_info = edd_get_payment_meta_user_info($payment_id);
    delete_transient('edd_user_' . $user_info['id'] . '_purchases');
}
开发者ID:harish94,项目名称:Easy-Digital-Downloads,代码行数:15,代码来源:actions.php


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