Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

RestApiUtil::calculate_refund_amount_from_line_items( WP_REST_Request $request )

Calculate the “amount” parameter for the request based on the amounts found in line items.


Description Description

This will ONLY be possible if ALL of the following is true:

  • "line_items" in the request is a non-empty array.
  • All line items have a "refund_total" field with a numeric value.
  • All values inside "refund_tax" in all line items are a numeric value.

The request is assumed to be in internal format already.


Parameters Parameters

$request

(Required) The request to maybe calculate the total amount for.


Top ↑

Return Return

(AutomatticWooCommerceInternalnumber|null) The calculated amount, or null if it can't be calculated.


Top ↑

Source Source

File: src/Internal/RestApiUtil.php


			


Top ↑

User Contributed Notes User Contributed Notes

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