WC_Gateway_Paypal_Refund::refund_order( WC_Order $order, float $amount = null, string $reason = '', bool $sandbox = false )

Process an order refund.


Description Description


Parameters Parameters

$order

(Required) Order object.

$amount

(Optional) Refund amount.

Default value: null

$reason

(Optional) Refund reason.

Default value: ''

$sandbox

(Optional) Whether to use sandbox mode or not.

Default value: false


Top ↑

Return Return

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


Top ↑

Source Source

File: includes/gateways/paypal/includes/class-wc-gateway-paypal-api-handler.php

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

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.