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
Return Return
(object) Either an object of name value pairs for a success, or a WP_ERROR object.
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; } }