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


PHP edd_get_payment_status函数代码示例

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


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

示例1: column_default

 function column_default($item, $column_name)
 {
     switch ($column_name) {
         case 'rate':
             $download = get_post_meta($item['ID'], '_download_id', true);
             $type = eddc_get_commission_type($download);
             if ('percentage' == $type) {
                 return $item[$column_name] . '%';
             } else {
                 return edd_currency_filter(edd_sanitize_amount($item[$column_name]));
             }
         case 'status':
             return $item[$column_name];
         case 'amount':
             return edd_currency_filter(edd_format_amount($item[$column_name]));
         case 'date':
             return date_i18n(get_option('date_format'), strtotime(get_post_field('post_date', $item['ID'])));
         case 'download':
             $download = !empty($item['download']) ? $item['download'] : false;
             return $download ? '<a href="' . esc_url(add_query_arg('download', $download)) . '" title="' . __('View all commissions for this item', 'eddc') . '">' . get_the_title($download) . '</a>' . (!empty($item['variation']) ? ' - ' . $item['variation'] : '') : '';
         case 'payment':
             $payment = get_post_meta($item['ID'], '_edd_commission_payment_id', true);
             return $payment ? '<a href="' . esc_url(admin_url('edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $payment)) . '" title="' . __('View payment details', 'eddc') . '">#' . $payment . '</a> - ' . edd_get_payment_status(get_post($payment), true) : '';
         default:
             return print_r($item, true);
             //Show the whole array for troubleshooting purposes
     }
 }
开发者ID:chriscct7,项目名称:EDD-Commissions-1,代码行数:28,代码来源:EDD_C_List_Table.php

示例2: pw_edd_pdf_invoices_for_pending

function pw_edd_pdf_invoices_for_pending($show_invoice, $payment_id)
{
    $status = edd_get_payment_status($payment_id);
    if ('pending' === $status) {
        $show_invoice = true;
    }
    return $show_invoice;
}
开发者ID:ramiabraham,项目名称:library,代码行数:8,代码来源:show-invoices-for-pending.php

示例3: status_update

 /**
  * Update the status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  * @param boolean			  $can_redirect (optional, defaults to false)
  */
 public static function status_update(Pronamic_Pay_Payment $payment, $can_redirect = false)
 {
     $source_id = $payment->get_source_id();
     $data = new Pronamic_WP_Pay_Extensions_EDD_PaymentData($source_id, array());
     // Only update if order is not completed
     $should_update = edd_get_payment_status($source_id) !== Pronamic_WP_Pay_Extensions_EDD_EasyDigitalDownloads::ORDER_STATUS_PUBLISH;
     // Defaults
     $status = null;
     $note = null;
     $url = $data->get_normal_return_url();
     $status = $payment->get_status();
     switch ($status) {
         case Pronamic_WP_Pay_Statuses::CANCELLED:
             $url = $data->get_cancel_url();
             break;
         case Pronamic_WP_Pay_Statuses::EXPIRED:
             if ($should_update) {
                 edd_update_payment_status($source_id, Pronamic_WP_Pay_Extensions_EDD_EasyDigitalDownloads::ORDER_STATUS_ABANDONED);
             }
             $url = $data->get_error_url();
             break;
         case Pronamic_WP_Pay_Statuses::FAILURE:
             if ($should_update) {
                 edd_update_payment_status($source_id, Pronamic_WP_Pay_Extensions_EDD_EasyDigitalDownloads::ORDER_STATUS_FAILED);
             }
             $url = $data->get_error_url();
             break;
         case Pronamic_WP_Pay_Statuses::SUCCESS:
             if ($should_update) {
                 edd_insert_payment_note($source_id, __('Payment completed.', 'pronamic_ideal'));
                 /*
                  * @see https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/2.2.8/includes/admin/payments/view-order-details.php#L36
                  * @see https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/2.2.8/includes/admin/payments/view-order-details.php#L199-L206
                  * @see https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/2.2.8/includes/payments/functions.php#L1312-L1332
                  * @see https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/2.2.8/includes/gateways/paypal-standard.php#L555-L576
                  */
             }
             edd_update_payment_status($source_id, Pronamic_WP_Pay_Extensions_EDD_EasyDigitalDownloads::ORDER_STATUS_PUBLISH);
             edd_empty_cart();
             $url = $data->get_success_url();
             break;
         case Pronamic_WP_Pay_Statuses::OPEN:
             if ($should_update) {
                 edd_insert_payment_note($source_id, __('Payment open.', 'pronamic_ideal'));
             }
             break;
         default:
             if ($should_update) {
                 edd_insert_payment_note($source_id, __('Payment unknown.', 'pronamic_ideal'));
             }
             break;
     }
     if ($can_redirect) {
         wp_redirect($url, 303);
         exit;
     }
 }
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:63,代码来源:Extension.php

示例4: 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

示例5: edd_bbp_sidebar

/**
 * EDD Forum Sidebar
 *
 * @since		1.0.0
 * @return		void
 */
function edd_bbp_sidebar()
{
    global $post;
    $user_id = get_the_author_meta('ID');
    $user_data = get_userdata($user_id);
    ?>
	<div class="box">

		<?php 
    do_action('edd_bbp_sidebar');
    ?>

		<h3><?php 
    echo get_the_author_meta('first_name') . '  ' . get_the_author_meta('last_name');
    ?>
</h3>
		<p class="bbp-user-forum-role"><?php 
    printf('Forum Role: %s', bbp_get_user_display_role($user_id));
    ?>
</p>
		<p class="bbp-user-topic-count"><?php 
    printf('Topics Started: %s', bbp_get_user_topic_count_raw($user_id));
    ?>
</p>
		<p class="bbp-user-reply-count"><?php 
    printf('Replies Created: %s', bbp_get_user_reply_count_raw($user_id));
    ?>
</p>

		<div class="rcp_support_status">
			<h4>Priority Support Access</h4>
			<?php 
    if (function_exists('rcp_is_active')) {
        if (rcp_is_active($user_id)) {
            ?>
				<p>Has <strong>Priority Support</strong> access.</p>
			<?php 
        } elseif (rcp_is_expired($user_id)) {
            ?>
				<p><strong>Priority Support</strong> access has <span style="color:red;">expired</span>.</p>
			<?php 
        } else {
            ?>
				<p>Has no priority support accesss</p>
			<?php 
        }
    }
    ?>
		</div><!-- /.rcp_support_status -->

		<div class="edd_users_purchases">
			<h4>User's Purchases:</h4>
			<?php 
    $purchases = edd_get_users_purchases($user_data->user_email, 100, false, 'any');
    if ($purchases) {
        echo '<ul>';
        foreach ($purchases as $purchase) {
            echo '<li>';
            echo '<strong><a href="' . admin_url('edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $purchase->ID) . '">#' . $purchase->ID . ' - ' . edd_get_payment_status($purchase, true) . '</a></strong><br/>';
            $downloads = edd_get_payment_meta_downloads($purchase->ID);
            foreach ($downloads as $download) {
                echo get_the_title($download['id']) . ' - ' . date('F j, Y', strtotime($purchase->post_date)) . '<br/>';
            }
            if (function_exists('edd_software_licensing')) {
                $licenses = edd_software_licensing()->get_licenses_of_purchase($purchase->ID);
                if ($licenses) {
                    echo '<strong>Licenses:</strong><br/>';
                    foreach ($licenses as $license) {
                        $key = edd_software_licensing()->get_license_key($license->ID);
                        echo '<a href="' . admin_url('edit.php?post_type=download&page=edd-licenses&s=' . $key) . '">' . $key . '</a>';
                        echo ' - ' . edd_software_licensing()->get_license_status($license->ID);
                        echo '<br/>';
                    }
                }
                echo '<hr/>';
            }
            echo '</li>';
        }
        echo '</ul>';
    } else {
        echo '<p>This user has never purchased anything.</p>';
    }
    ?>
		</div>
	</div>
	<?php 
}
开发者ID:Section214,项目名称:EDD-bbPress-Support,代码行数:93,代码来源:support-functions.php

示例6: edd_currency_filter

</td>
                                                        					<td class="edd_purchase_amount">
                                                        						<span class="edd_purchase_amount"><?php 
                        echo edd_currency_filter(edd_format_amount(edd_get_payment_amount($post->ID)));
                        ?>
</span>
                                                        					</td>
                                                        					<td class="edd_purchase_details">
                                                        						<?php 
                        if ($post->post_status != 'publish') {
                            ?>
                                                        						<span class="edd_purchase_status <?php 
                            echo $post->post_status;
                            ?>
"><?php 
                            echo edd_get_payment_status($post, true);
                            ?>
</span>
                                                        						<a href="<?php 
                            echo esc_url(add_query_arg('payment_key', edd_get_payment_key($post->ID), edd_get_success_page_uri()));
                            ?>
">&raquo;</a>
                                                        						<?php 
                        } else {
                            ?>
                                                        						<a href="<?php 
                            echo esc_url(add_query_arg('payment_key', edd_get_payment_key($post->ID), edd_get_success_page_uri()));
                            ?>
"><?php 
                            _e('View Details and Downloads', 'edd');
                            ?>
开发者ID:wpmonty,项目名称:99-demos,代码行数:31,代码来源:tpl-account.php

示例7: edd_userpro_embed_profile_fields

function edd_userpro_embed_profile_fields($hook_args)
{
    if (!current_user_can('edit_user', $hook_args['user_id'])) {
        return;
    }
    echo '<div class="userpro-section userpro-column userpro-collapsible-1 userpro-collapsed-1">' . __('Purchase History', 'edd-userpro-embed') . '</div>';
    echo '<div class="userpro-field userpro-field-edd-purchase-history userpro-field-view" data-key="edd-purchase-history">';
    $purchases = edd_get_users_purchases($hook_args['user_id'], 99999, true, 'any');
    if ($purchases) {
        do_action('edd_before_purchase_history');
        ?>
		<table id="edd_user_history">
			<thead>
				<tr class="edd_purchase_row">
					<?php 
        do_action('edd_purchase_history_header_before');
        ?>
					<th class="edd_purchase_id"><?php 
        _e('ID', 'easy-digital-downloads');
        ?>
</th>
					<th class="edd_purchase_date"><?php 
        _e('Date', 'easy-digital-downloads');
        ?>
</th>
					<th class="edd_purchase_amount"><?php 
        _e('Amount', 'easy-digital-downloads');
        ?>
</th>
					<th class="edd_purchase_details"><?php 
        _e('Details', 'easy-digital-downloads');
        ?>
</th>
					<?php 
        do_action('edd_purchase_history_header_after');
        ?>
				</tr>
			</thead>
			<?php 
        foreach ($purchases as $post) {
            setup_postdata($post);
            ?>
				<?php 
            $purchase_data = edd_get_payment_meta($post->ID);
            ?>
				<tr class="edd_purchase_row">
					<?php 
            do_action('edd_purchase_history_row_start', $post->ID, $purchase_data);
            ?>
					<td class="edd_purchase_id">#<?php 
            echo edd_get_payment_number($post->ID);
            ?>
</td>
					<td class="edd_purchase_date"><?php 
            echo date_i18n(get_option('date_format'), strtotime(get_post_field('post_date', $post->ID)));
            ?>
</td>
					<td class="edd_purchase_amount">
						<span class="edd_purchase_amount"><?php 
            echo edd_currency_filter(edd_format_amount(edd_get_payment_amount($post->ID)));
            ?>
</span>
					</td>
					<td class="edd_purchase_details">
						<?php 
            if ($post->post_status != 'publish') {
                ?>
						<span class="edd_purchase_status <?php 
                echo $post->post_status;
                ?>
"><?php 
                echo edd_get_payment_status($post, true);
                ?>
</span>
						<a href="<?php 
                echo esc_url(add_query_arg('payment_key', edd_get_payment_key($post->ID), edd_get_success_page_uri()));
                ?>
">&raquo;</a>
						<?php 
            } else {
                ?>
						<a href="<?php 
                echo esc_url(add_query_arg('payment_key', edd_get_payment_key($post->ID), edd_get_success_page_uri()));
                ?>
"><?php 
                _e('View Details', 'edd-userpro-embed');
                ?>
</a>
						<?php 
            }
            ?>
					</td>
					<?php 
            do_action('edd_purchase_history_row_end', $post->ID, $purchase_data);
            ?>
				</tr>
			<?php 
        }
        ?>
		</table>
//.........这里部分代码省略.........
开发者ID:easydigitaldownloads,项目名称:EDD-UserPro-Embed,代码行数:101,代码来源:profile.php

示例8: edd_customers_view


//.........这里部分代码省略.........
    ?>
</th>
					<th><?php 
    _e('Status', 'edd');
    ?>
</th>
					<th><?php 
    _e('Actions', 'edd');
    ?>
</th>
				</tr>
			</thead>
			<tbody>
				<?php 
    if (!empty($payments)) {
        ?>
					<?php 
        foreach ($payments as $payment) {
            ?>
						<tr>
							<td><?php 
            echo $payment->ID;
            ?>
</td>
							<td><?php 
            echo edd_payment_amount($payment->ID);
            ?>
</td>
							<td><?php 
            echo date_i18n(get_option('date_format'), strtotime($payment->post_date));
            ?>
</td>
							<td><?php 
            echo edd_get_payment_status($payment, true);
            ?>
</td>
							<td>
								<a title="<?php 
            _e('View Details for Payment', 'edd');
            echo ' ' . $payment->ID;
            ?>
" href="<?php 
            echo admin_url('edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id=' . $payment->ID);
            ?>
">
									<?php 
            _e('View Details', 'edd');
            ?>
								</a>
								<?php 
            do_action('edd_customer_recent_purcahses_actions', $customer, $payment);
            ?>
							</td>
						</tr>
					<?php 
        }
        ?>
				<?php 
    } else {
        ?>
					<tr><td colspan="5"><?php 
        _e('No Payments Found', 'edd');
        ?>
</td></tr>
				<?php 
    }
开发者ID:evinw,项目名称:project_3dBP,代码行数:67,代码来源:customers.php

示例9: edd_payment_history_page


//.........这里部分代码省略.........
                ?>
											<div class="purchase-key-wrap">
												<h4><?php 
                _e('Purchase Key', 'edd');
                ?>
</h4>
												<span class="purchase-key"><?php 
                echo $payment_meta['key'];
                ?>
</span>
											</div>
											<p><a id="edd-close-purchase-details" class="button-secondary" onclick="tb_remove();" title="<?php 
                _e('Close', 'edd');
                ?>
"><?php 
                _e('Close', 'edd');
                ?>
</a></p>
										</div>
									</td>
									<td style="text-transform:uppercase;"><?php 
                echo edd_currency_filter($payment_meta['amount']);
                ?>
</td>
									<td><?php 
                echo date(apply_filters('edd_payments_page_date_format', get_option('date_format')), strtotime($payment->post_date));
                ?>
</td>
									<td>
										<?php 
                $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
                ?>
										<a href="<?php 
                echo remove_query_arg('p', add_query_arg('user', $user_id));
                ?>
">
											<?php 
                if (is_numeric($user_id)) {
                    $user = get_user_by('id', $user_id);
                    echo is_object($user) ? $user->display_name : __('guest', 'edd');
                } else {
                    echo __('guest', 'edd');
                }
                ?>
										</a>
									</td>
									<td><?php 
                echo edd_get_payment_status($payment, true);
                ?>
</td>
								</tr>
							<?php 
                $i++;
            }
        } else {
            ?>
						<tr><td colspan="7"><?php 
            _e('No payments recorded yet', 'edd');
            ?>
</td></tr>
					<?php 
        }
        ?>
				</table>
				<div class="tablenav">

					<div class="left edd-total-earnings">
						<p><?php 
        _e('Total Earnings:', 'edd');
        ?>
&nbsp;<strong><?php 
        echo edd_get_total_earnings();
        ?>
</strong></p>
						<?php 
        do_action('edd_payments_page_earnings');
        ?>
					</div>
					<?php 
        if ($total_pages > 1) {
            ?>
						<div class="tablenav-pages alignright">
							<?php 
            $query_string = $_SERVER['QUERY_STRING'];
            $base = 'edit.php?' . remove_query_arg('p', $query_string) . '%_%';
            echo paginate_links(array('base' => $base, 'format' => '&p=%#%', 'prev_text' => '&laquo; ' . __('Previous', 'edd'), 'next_text' => __('Next', 'edd') . ' &raquo;', 'total' => $total_pages, 'current' => $page, 'end_size' => 1, 'mid_size' => 5));
            ?>
	
						</div>
					<?php 
        }
        ?>
				</div><!--end .tablenav-->
				<?php 
        do_action('edd_payments_page_bottom');
        ?>
		</div><!--end wrap-->
		<?php 
    }
}
开发者ID:ryannmicua,项目名称:Easy-Digital-Downloads,代码行数:101,代码来源:payments-history.php

示例10: get_attendees

 /**
  * Get all the attendees for an event. It returns an array with the
  * following fields:
  *  'order_id'
  *  'order_status'
  *  'purchaser_name'
  *  'purchaser_email'
  *  'ticket'
  *  'attendee_id'
  *  'security'
  *  'product_id'
  *  'check_in'
  *  'provider'
  *
  * @param $event_id
  *
  * @return array
  */
 protected function get_attendees($event_id)
 {
     $args = array('posts_per_page' => -1, 'post_type' => self::ATTENDEE_OBJECT, 'meta_key' => self::ATTENDEE_EVENT_KEY, 'meta_value' => $event_id, 'orderby' => 'ID', 'order' => 'DESC');
     $attendees_query = new WP_Query($args);
     if (!$attendees_query->have_posts()) {
         return array();
     }
     $attendees = array();
     foreach ($attendees_query->posts as $attendee) {
         $order_id = get_post_meta($attendee->ID, self::ATTENDEE_ORDER_KEY, true);
         $checkin = get_post_meta($attendee->ID, self::$checkin_key, true);
         $security = get_post_meta($attendee->ID, self::$security_code, true);
         $product_id = get_post_meta($attendee->ID, self::ATTENDEE_PRODUCT_KEY, true);
         $user_info = edd_get_payment_meta_user_info($order_id);
         $name = $user_info['first_name'] . ' ' . $user_info['last_name'];
         $email = $user_info['email'];
         $order_status = get_post_field('post_status', $order_id);
         $status_label = edd_get_payment_status(get_post($order_id), true);
         $order_warning = 'publish' !== $order_status;
         if (empty($product_id)) {
             continue;
         }
         $product = get_post($product_id);
         $product_title = !empty($product) ? $product->post_title : get_post_meta($attendee->ID, $this->deleted_product, true) . ' ' . __('(deleted)', 'eddtickets');
         $attendees[] = array('order_id' => $order_id, 'order_status' => $status_label, 'order_warning' => $order_warning, 'purchaser_name' => $name, 'purchaser_email' => $email, 'ticket' => $product_title, 'attendee_id' => $attendee->ID, 'security' => $security, 'product_id' => $product_id, 'check_in' => $checkin, 'provider' => __CLASS__);
     }
     return $attendees;
 }
开发者ID:jamestrevorlees,项目名称:odd-web-v1.00,代码行数:46,代码来源:Main.php

示例11: column_default

 /**
  * Render most columns
  *
  * @access      private
  * @since       1.3.4
  * @return      string
  */
 function column_default($item, $column_name)
 {
     switch ($column_name) {
         case 'amount':
             return edd_currency_filter(edd_format_amount($item[$column_name]));
         case 'date':
             $date = strtotime($item[$column_name]);
             return date_i18n(get_option('date_format'), $date);
         case 'status':
             $payment = get_post($item['ID']);
             return edd_get_payment_status($payment, true);
         default:
             return $item[$column_name];
     }
 }
开发者ID:vheidari,项目名称:Easy-Digital-Downloads,代码行数:22,代码来源:class-payments-table.php

示例12: edd_undo_purchase

/**
 * Undos a purchase, including the decrease of sale and earning stats
 *
 * Used for when refunding or deleting a purchase
 *
 * @access      public
 * @since       1.0.8.1
 * @param       int $download_id - the ID number of the download
 * @param       int $payment_id - the ID number of the purchase
 * @return      
*/
function edd_undo_purchase($download_id, $payment_id)
{
    $payment = get_post($payment_id);
    if (edd_get_payment_status($payment) == 'refunded') {
        return;
    }
    // payment has already been reversed
    edd_decrease_purchase_count($download_id);
    $purchase_meta = edd_get_payment_meta($payment_id);
    $user_purchase_info = maybe_unserialize($purchase_meta['user_info']);
    $cart_details = maybe_unserialize($purchase_meta['cart_details']);
    $amount = null;
    if (is_array($cart_details)) {
        $cart_item_id = array_search($download_id, $cart_details);
        $amount = isset($cart_details[$cart_item_id]['price']) ? $cart_details[$cart_item_id]['price'] : null;
    }
    $amount = edd_get_download_final_price($download_id, $user_purchase_info, $amount);
    edd_decrease_earnings($download_id, $amount);
}
开发者ID:ryannmicua,项目名称:Easy-Digital-Downloads,代码行数:30,代码来源:payment-functions.php

示例13: edd_export_payment_history

/**
 * Export all Payment History to CSV
 *
 * @access      private
 * @since       1.2
 * @return      void
 */
function edd_export_payment_history()
{
    global $edd_options;
    ignore_user_abort(true);
    if (!edd_is_func_disabled('set_time_limit') && !ini_get('safe_mode')) {
        set_time_limit(0);
    }
    $mode = edd_is_test_mode() ? 'test' : 'live';
    header('Content-Type: text/csv; charset=utf-8');
    header('Content-Disposition: attachment; filename=edd-payment-history-' . date('m-d-Y') . '.csv');
    header("Pragma: no-cache");
    header("Expires: 0");
    $payments = edd_get_payments(array('offset' => 0, 'number' => -1, 'mode' => $mode));
    if ($payments) {
        $i = 0;
        echo '"' . __('ID', 'edd') . '",';
        echo '"' . __('Email', 'edd') . '",';
        echo '"' . __('First Name', 'edd') . '",';
        echo '"' . __('Last Name', 'edd') . '",';
        echo '"' . __('Products', 'edd') . '",';
        echo '"' . __('Discounts,', 'edd') . '",';
        echo '"' . __('Amount paid', 'edd') . '",';
        if (edd_use_taxes()) {
            echo '"' . __('Amount taxed', 'edd') . '",';
        }
        echo '"' . __('Payment method', 'edd') . '",';
        echo '"' . __('Key', 'edd') . '",';
        echo '"' . __('Date', 'edd') . '",';
        echo '"' . __('User', 'edd') . '",';
        echo '"' . __('Status', 'edd') . '"';
        echo "\r\n";
        foreach ($payments as $payment) {
            $payment_meta = edd_get_payment_meta($payment->ID);
            $user_info = edd_get_payment_meta_user_info($payment->ID);
            echo '"' . $payment->ID . '",';
            echo '"' . $payment_meta['email'] . '",';
            echo '"' . $user_info['first_name'] . '",';
            echo '"' . $user_info['last_name'] . '",';
            $downloads = edd_get_payment_meta_cart_details($payment->ID);
            if (empty($downloads) || !$downloads) {
                $downloads = maybe_unserialize($payment_meta['downloads']);
            }
            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;
                    $user_info = unserialize($payment_meta['user_info']);
                    $price = edd_get_download_final_price($id, $user_info, $price_override);
                    // Display the Downoad Name
                    echo '"' . get_the_title($id);
                    echo ' - ';
                    if (isset($downloads[$key]['item_number'])) {
                        $price_options = $downloads[$key]['item_number']['options'];
                        if (isset($price_options['price_id'])) {
                            echo edd_get_price_option_name($id, $price_options['price_id']);
                            echo ' - ';
                        }
                    }
                    echo html_entity_decode(edd_currency_filter($price));
                    if ($key != count($downloads) - 1) {
                        echo ' / ';
                    }
                }
                echo '",';
            }
            if (isset($user_info['discount']) && $user_info['discount'] != 'none') {
                echo '"' . $user_info['discount'] . '",';
            } else {
                echo '"' . __('none', 'edd') . '",';
            }
            echo '"' . html_entity_decode(edd_currency_filter(edd_format_amount($payment_meta['amount']))) . '",';
            if (edd_use_taxes()) {
                echo '"' . html_entity_decode(edd_payment_tax($payment->ID, $payment_meta)) . '",';
            }
            $gateway = get_post_meta($payment->ID, '_edd_payment_gateway', true);
            if ($gateway) {
                echo '"' . edd_get_gateway_admin_label($gateway) . '",';
            } else {
                echo '"' . __('none', 'edd') . '",';
            }
            echo '"' . $payment_meta['key'] . '",';
            echo '"' . date_i18n(get_option('date_format'), strtotime($payment->post_date)) . '",';
            $user_id = isset($user_info['id']) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email'];
            echo '"' . is_numeric($user_id) ? get_user_by('id', $user_id)->display_name : __('guest', 'edd') . '",';
            echo '"' . edd_get_payment_status($payment, true) . '"';
            echo "\r\n";
            $i++;
        }
    } else {
        echo __('No payments recorded yet', 'edd');
    }
//.........这里部分代码省略.........
开发者ID:vheidari,项目名称:Easy-Digital-Downloads,代码行数:101,代码来源:export-functions.php

示例14: render_purchase_history

 /**
  * Output customer purchase history.
  *
  * @since 1.5.0
  *
  * @param object $order Order post object.
  */
 public function render_purchase_history($payment_id = 0)
 {
     // If no order object is available, bail here
     if (empty($payment_id)) {
         return false;
     }
     // Get relevant payment details
     $payment_meta = edd_get_payment_meta($payment_id);
     // Setup important variables
     $lifetime_total = 0;
     $payments = get_posts(array('numberposts' => -1, 'meta_key' => '_edd_payment_user_email', 'meta_value' => $payment_meta['email'], 'post_type' => 'edd_payment', 'order' => 'ASC', 'post_status' => 'any'));
     // Initialize output
     $output = '';
     $output .= '<div class="products-header spacing-wrapper clearfix"></div>';
     $output .= '<div class="spacing-wrapper clearfix">';
     // Include a header
     $output .= sprintf('<p>%s</p>', __('Below is every order this customer has completed, including this one (highlighted).', 'edduh'));
     // Output purhcase history table
     $output .= '<table style="width:100%; border:1px solid #eee;" cellpadding="0" cellspacing="0" border="0">';
     $output .= '<tr>';
     $output .= '<th style="background:#333; color:#fff; text-align:left; padding:10px;">' . __('Order Number', 'edduh') . '</th>';
     $output .= '<th style="background:#333; color:#fff; text-align:left; padding:10px;">' . __('Order Date', 'edduh') . '</th>';
     $output .= '<th style="background:#333; color:#fff; text-align:left; padding:10px;">' . __('Order Status', 'edduh') . '</th>';
     $output .= '<th style="background:#333; color:#fff; text-align: right; padding:10px;">' . __('Order Total', 'edduh') . '</th>';
     $output .= '</tr>';
     if (!empty($payments)) {
         foreach ($payments as $key => $payment) {
             $payment = get_post($payment->ID);
             $alt = $key % 2 ? ' style="background: #f7f7f7;"' : '';
             $current = $payment->ID == $payment_id ? ' style="background: #ffc; font-weight: bold"' : $alt;
             $output .= '<tr' . $current . '>';
             $output .= '<td style="text-align:left; padding:10px;">' . ($key + 1) . '. <a href="' . admin_url("edit.php?post_type=download&page=edd-payment-history&view=view-order-details&id={$payment->ID}") . '">' . sprintf(__('Order #%d', 'edduh'), $payment->ID) . '</a></td>';
             $output .= '<td style="text-align:left; padding:10px;">' . date('Y-m-d h:ia', strtotime($payment->post_date)) . '</td>';
             $output .= '<td style="text-align:left; padding:10px;">' . edd_get_payment_status($payment, true) . '</td>';
             $output .= '<td style="text-align:right; padding:10px;">' . edd_currency_filter(edd_format_amount(edd_get_payment_amount($payment->ID))) . '</td>';
             $output .= '</tr>';
             if ('publish' == $payment->post_status) {
                 $lifetime_total += edd_get_payment_amount($payment->ID);
             }
         }
     }
     $output .= '</table>';
     // Output total lifetime value
     $output .= '<p>';
     $output .= sprintf(__('<strong>Actual Lifetime Customer Value:</strong> %s', 'edduh'), '<span style="color:#7EB03B; font-size: 1.2em;">' . edd_currency_filter(edd_format_amount($lifetime_total)) . '</span>');
     $output .= '</p>';
     // Close out the container
     $output .= '</div>';
     return $output;
 }
开发者ID:nguyenthai2010,项目名称:ngocshop,代码行数:57,代码来源:show-history.php

示例15: do_action

                                ?>
												</a>
											</div>

											<?php 
                                do_action('edd_download_history_files', $filekey, $file, $id, $payment->ID, $purchase_data);
                            }
                        } else {
                            _e('No downloadable files found.', 'edd');
                        }
                        // End if payment complete
                    } else {
                        ?>
									<span class="edd_download_payment_status">
										<?php 
                        printf(__('Payment status is %s', 'edd'), edd_get_payment_status($payment, true));
                        ?>
									</span>
									<?php 
                    }
                    // End if $download_files
                    ?>
							</td>
						<?php 
                }
                // End if ! edd_no_redownload()
                do_action('edd_download_history_row_end', $payment->ID, $download['id']);
                ?>
					</tr>
					<?php 
            }
开发者ID:nitun,项目名称:Easy-Digital-Downloads,代码行数:31,代码来源:history-downloads.php


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