WC_Gateway_Paypal_Refund

Here for backwards compatibility.


Description Description


Source Source

File: includes/gateways/paypal/includes/class-wc-gateway-paypal-api-handler.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;
		}
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

Methods Methods

  • get_request — Get refund request args. Proxy to WC_Gateway_Paypal_API_Handler::get_refund_request().
  • refund_order — Process an order refund.

Top ↑

User Contributed Notes User Contributed Notes

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