コード例 #1
0
/**
 * Track number of purchases for each pledge amount.
 *
 * @since Astoundify Crowdfunding 0.9
 *
 * @param int $payment the ID number of the payment
 * @param array $payment_data The payment data for the cart
 * @return void
 */
function atcf_log_pledge_limit($payment_id, $new_status, $old_status)
{
    global $edd_logs;
    // Make sure that payments are only completed once
    if ($old_status != 'pending') {
        return;
    }
    // Make sure the payment completion is only processed when new status is complete
    if (in_array($new_status, array('refunded', 'failed', 'revoked', 'cancelled', 'abandoned'))) {
        return;
    }
    if (edd_is_test_mode() && !apply_filters('edd_log_test_payment_stats', false)) {
        return;
    }
    atcf_update_backer_count($payment_id, 'increase');
}
コード例 #2
0
/**
 * Track number of purchases for each pledge amount.
 *
 * @since Astoundify Crowdfunding 0.9
 *
 * @param int $payment the ID number of the payment
 * @param array $payment_data The payment data for the cart
 * @return void
 */
function atcf_log_pledge_limit($payment_id, $new_status, $old_status)
{
    global $edd_logs;
    // If we're in test mode, don't proceed unless expected.
    if (edd_is_test_mode() && !apply_filters('edd_log_test_payment_stats', false)) {
        return;
    }
    // Increase payment stats for the campaigns.
    if (atcf_should_increase_payment_stats($new_status, $old_status)) {
        atcf_update_backer_count($payment_id, 'increase');
    }
    // Decrease payment stats for the campaigns.
    if (atcf_should_decrease_payment_stats($new_status, $old_status)) {
        atcf_update_backer_count($payment_id, 'decrease');
    }
}
コード例 #3
0
/**
 * Decrease the purchase count of each reward when a payment
 * is deleted.
 *
 * @since Astoundify Crowdfunding 1.7.2
 *
 * @param int $payment_id The ID of the payment that was deleted.
 * @return void
 */
function atcf_edd_payment_delete($payment_id)
{
    atcf_update_backer_count($payment_id, 'decrease');
}