Give_Payment::process_refund PHP Method

process_refund() private method

When a payment is set to a status of 'refunded' process the necessary actions to reduce stats
Since: 1.5
private process_refund ( ) : void
return void
    private function process_refund()
    {
        $process_refund = true;
        // If the payment was not in publish or revoked status, don't decrement stats as they were never incremented
        if ('publish' != $this->old_status || 'refunded' != $this->status) {
            $process_refund = false;
        }
        // Allow extensions to filter for their own payment types, Example: Recurring Payments
        $process_refund = apply_filters('give_should_process_refund', $process_refund, $this);
        if (false === $process_refund) {
            return;
        }
        do_action('give_pre_refund_payment', $this);
        $decrease_store_earnings = apply_filters('give_decrease_store_earnings_on_refund', true, $this);
        $decrease_customer_value = apply_filters('give_decrease_customer_value_on_refund', true, $this);
        $decrease_purchase_count = apply_filters('give_decrease_customer_purchase_count_on_refund', true, $this);
        $this->maybe_alter_stats($decrease_store_earnings, $decrease_customer_value, $decrease_purchase_count);
        $this->delete_sales_logs();
        // Clear the This Month earnings (this_monththis_month is NOT a typo)
        delete_transient(md5('give_earnings_this_monththis_month'));
        do_action('give_post_refund_payment', $this);
    }