• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_Payment::process_refund() – When a payment is set to a status of ‘refunded’ process the necessary actions to reduce stats

You appear to be a bot. Output may be restricted

Description

When a payment is set to a status of 'refunded' process the necessary actions to reduce stats

Usage

$void = EDD_Payment::process_refund();

Parameters

Returns

void

Source

File name: easy-digital-downloads/includes/payments/class-edd-payment.php
Lines:

1 to 29 of 29
  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 && 'revoked' != $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( 'edd_should_process_refund', $process_refund, $this );

    if ( false === $process_refund ) {
      return;
    }

    do_action( 'edd_pre_refund_payment', $this );

    $decrease_store_earnings = apply_filters( 'edd_decrease_store_earnings_on_refund', true, $this );
    $decrease_customer_value = apply_filters( 'edd_decrease_customer_value_on_refund', true, $this );
    $decrease_purchase_count = apply_filters( 'edd_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( 'edd_earnings_this_monththis_month' ) );

    do_action( 'edd_post_refund_payment', $this );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 6th June 2020

Primary Sidebar

Information

Function name: EDD_Payment::process_refund
Class ref: EDD_Payment
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/payments/class-edd-payment.php
File ref: includes/payments/class-edd-payment.php
Deprecated?: No
API Letters: E,P,R

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites