• 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_maybe_refund_paypal_purchase() – Possibly refunds a payment made with PayPal Standard or PayPal Express.

You appear to be a bot. Output may be restricted

Description

Possibly refunds a payment made with PayPal Standard or PayPal Express.

Usage

$void = edd_maybe_refund_paypal_purchase( $payment );

Parameters

$payment
( mixed ) required –

Returns

void

Source

File name: easy-digital-downloads/includes/gateways/paypal-standard.php
Lines:

1 to 32 of 32
function edd_maybe_refund_paypal_purchase( EDD_Payment $payment ) {


  if( ! current_user_can( 'edit_shop_payments', $payment->ID ) ) {
    return;
  }

  if( empty( $_POST['edd-paypal-refund'] ) ) {
    return;
  }

  $processed = $payment->get_meta( '_edd_paypal_refunded', true );

  // If the status is not set to "refunded", return early.
  if ( 'publish' !== $payment->old_status && 'revoked' !== $payment->old_status ) {
    return;
  }

  // If not PayPal/PayPal Express, return early.
  if ( 'paypal' !== $payment->gateway ) {
    return;
  }

  // If the payment has already been refunded in the past, return early.
  if ( $processed ) {
    return;
  }

  // Process the refund in PayPal.
  edd_refund_paypal_purchase( $payment );

}
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 13th March 2021

Primary Sidebar

Information

Function name: edd_maybe_refund_paypal_purchase
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/gateways/paypal-standard.php
File ref: includes/gateways/paypal-standard.php
Deprecated?: No
API Letters: E,M,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