WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_Refund::refund_order() public WC 1.0

Process an order refund.

{} It's a method of the class: WC_Gateway_Paypal_Refund{}

No Hooks.

Return

Object. Either an object of name value pairs for a success, or a WP_ERROR object.

Usage

$result = WC_Gateway_Paypal_Refund::refund_order( $order, $amount, $reason, $sandbox );
$order(WC_Order) (required)
Order object.
$amount(float)
Refund amount.
Default: null
$reason(string)
Refund reason.
Default: ''
$sandbox(true|false)
Whether to use sandbox mode or not.
Default: false

Code of WC_Gateway_Paypal_Refund::refund_order() WC 5.7.1

public static function refund_order( $order, $amount = null, $reason = '', $sandbox = false ) {
	if ( $sandbox ) {
		self::$sandbox = $sandbox;
	}
	$result = self::refund_transaction( $order, $amount, $reason );
	if ( is_wp_error( $result ) ) {
		return $result;
	} else {
		return (array) $result;
	}
}