WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
класс не описан

WC_Gateway_Paypal_Refund{} WC 3.0.0

Here for backwards compatibility.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$WC_Gateway_Paypal_Refund = new WC_Gateway_Paypal_Refund();
// use class methods

Методы

  1. get_request( $order, $amount = null, $reason = '' )
  2. refund_order( $order, $amount = null, $reason = '', $sandbox = false )

Список изменений

С версии 3.0.0 Введена.

Код WC_Gateway_Paypal_Refund{} WC 4.6.0

<?php
class WC_Gateway_Paypal_Refund extends WC_Gateway_Paypal_API_Handler {
	/**
	 * Get refund request args. Proxy to WC_Gateway_Paypal_API_Handler::get_refund_request().
	 *
	 * @param WC_Order $order Order object.
	 * @param float    $amount Refund amount.
	 * @param string   $reason Refund reason.
	 *
	 * @return array
	 */
	public static function get_request( $order, $amount = null, $reason = '' ) {
		return self::get_refund_request( $order, $amount, $reason );
	}

	/**
	 * Process an order refund.
	 *
	 * @param  WC_Order $order Order object.
	 * @param  float    $amount Refund amount.
	 * @param  string   $reason Refund reason.
	 * @param  bool     $sandbox Whether to use sandbox mode or not.
	 * @return object Either an object of name value pairs for a success, or a WP_ERROR object.
	 */
	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;
		}
	}
}