woocommerce_api_create_order_refund_data

woocommerce_api_create_order_refund_data

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_api_create_order_refund_data') is found 2 times:

  • /includes/legacy/api/v2/class-wc-api-orders.php line 1595
    			if ( empty( $order_id ) ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_order_id', __( 'Order ID is invalid', 'woocommerce' ), 400 );
    			}
    
    			$data = apply_filters( 'woocommerce_api_create_order_refund_data', $data, $order_id, $this );
    
    			// Refund amount is required
    			if ( ! isset( $data['amount'] ) ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_order_refund', __( 'Refund amount is required.', 'woocommerce' ), 400 );
    			} elseif ( 0 > $data['amount'] ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_order_refund', __( 'Refund amount must be positive.', 'woocommerce' ), 400 );
    
  • /includes/legacy/api/v3/class-wc-api-orders.php line 1640
    			if ( empty( $order_id ) ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_order_id', __( 'Order ID is invalid', 'woocommerce' ), 400 );
    			}
    
    			$data = apply_filters( 'woocommerce_api_create_order_refund_data', $data, $order_id, $this );
    
    			// Refund amount is required
    			if ( ! isset( $data['amount'] ) ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_order_refund', __( 'Refund amount is required.', 'woocommerce' ), 400 );
    			} elseif ( 0 > $data['amount'] ) {
    				throw new WC_API_Exception( 'woocommerce_api_invalid_order_refund', __( 'Refund amount must be positive.', 'woocommerce' ), 400 );