Automattic\WooCommerce\Internal\ReceiptRendering

ReceiptRenderingRestController::get_response_for_fileprivateWC 1.0

Formats the response for both the GET and POST endpoints.

Метод класса: ReceiptRenderingRestController{}

Хуков нет.

Возвращает

Массив. The data for the actual response to be returned.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_response_for_file( $filename ): array;
$filename(строка) (обязательный)
The filename to return the information for.

Код ReceiptRenderingRestController::get_response_for_file() WC 10.3.6

private function get_response_for_file( string $filename ): array {
	$expiration_date = TransientFilesEngine::get_expiration_date( $filename );
	$public_url      = wc_get_container()->get( TransientFilesEngine::class )->get_public_url( $filename );

	return array(
		'receipt_url'     => $public_url,
		'expiration_date' => $expiration_date,
	);
}