WC_Gateway_Paypal_Refund::refund_order()
Process an order refund.
Метод класса: WC_Gateway_Paypal_Refund{}
Хуков нет.
Возвращает
Объект
. Either an object of name value pairs for a success, or a WP_ERROR object.
Использование
$result = WC_Gateway_Paypal_Refund::refund_order( $order, $amount, $reason, $sandbox );
- $order(WC_Order) (обязательный)
- Order object.
- $amount(float)
- Refund amount.
По умолчанию: null - $reason(строка)
- Refund reason.
По умолчанию: '' - $sandbox(true|false)
- Whether to use sandbox mode or not.
По умолчанию: false
Код WC_Gateway_Paypal_Refund::refund_order() WC Gateway Paypal Refund::refund order WC 9.3.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; } }