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 ); }